My hosting service uses a non standard port (3336) for MySQL.
I tried setting the "host" field to "localhost:3336", but it didn't work...
can not use MySQL with non standard port
(9 posts) (2 voices)-
Posted 1 year ago #
-
It's exact, MySQL port is not configurable right now. We should allow that and we will as soon as possible. Just have to wait i write the code to support it :-)
Posted 1 year ago # -
I just committed a change:
http://ladistribution.net/trac/changeset/439You can test it with the 'edge' version of La Distribution which you can install:
1) from SVN
2) by setting define('LD_RELEASE', 'edge') in installer.php
3) or by defining your main repository to http://ladistribution.net/repositories/edge/main in your preferencesDoes it works for you ?
Posted 1 year ago # -
Not yet... I hacked the source to display the exception :
Looks like something is missing from my configuration...
Note that, when running installer.php, it resulted into two lines of garbage instead of a clean page, but the installation semmed to work appart from that. Could this be related?exception 'Zend_Db_Adapter_Mysqli_Exception' with message 'The Mysqli extension is required for this adapter but the extension is not loaded' in /dusers/pchampin/ladist2/lib/Zend/Db/Adapter/Mysqli.php:291
Stack trace:
#0 /dusers/pchampin/ladist2/lib/Zend/Db/Adapter/Abstract.php(448): Zend_Db_Adapter_Mysqli->_connect()
#1 /dusers/pchampin/ladist2/lib/Zend/Db/Adapter/Abstract.php(765): Zend_Db_Adapter_Abstract->query('SHOW TABLES', Array)
#2 /dusers/pchampin/ladist2/lib/Ld/Site/Local.php(722): Zend_Db_Adapter_Abstract->fetchCol('SHOW TABLES')
#3 /dusers/pchampin/ladist2/lib/Ld/Site/Local.php(687): Ld_Site_Local->_testDatabase(Array)
#4 /dusers/pchampin/ladist2/shared/modules/slotter/controllers/DatabasesController.php(68): Ld_Site_Local->addDatabase(Array)
#5 /dusers/pchampin/ladist2/lib/Zend/Controller/Action.php(513): Slotter_DatabasesController->newAction()
#6 /dusers/pchampin/ladist2/lib/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('newAction')
#7 /dusers/pchampin/ladist2/lib/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#8 /dusers/pchampin/ladist2/admin/Bootstrap.php(143): Zend_Controller_Front->dispatch()
#9 /dusers/pchampin/ladist2/admin/Bootstrap.php(14): Bootstrap::dispatch()
#10 /dusers/pchampin/ladist2/admin/index.php(9): Bootstrap::run('/dusers/pchampi...')
#11 /dusers/pchampin/ladist2/admin/dispatch.php(62): require_once('/dusers/pchampi...')
#12 /dusers/pchampin/ladist2/index.php(3): require_once('/dusers/pchampi...')
#13 {main}Posted 1 year ago # -
Well, it is assumed that the 'mysqli' php extension is installed. I can't help you for now. On what sort of server are you trying to install it?
To enable debugging, you can add define('LD_DEBUG', true) in installer.php. Or after installation in the top of dist/config.php.
Finally, for our information, it would be helpful to know the "garbage" you got in the installation procedure.
Posted 1 year ago # -
Ok, I now have mysqli compiled into my PHP distribution. However, I still have some problems, at Zend/Db/Adapter/Mysqli.php, line 333 :
'Can't connect to local MySQL server through socket '/tmp/mysql.sock'it seems that mysqli_real_connect is tring to connect through a UNIX socket, even when provided with an explicit port. Note that the documentation
http://php.net/manual/en/mysqli.real-connect.php
is quite explicit about it: if the host is localhost, UNIX sockets will be prefered to TCP sockets...Note that I know the name of the UNIX socket that I want to use, so instead of localhost:3336; I could type localhost:/path/to/socket... Then the socket name could be passed down to mysqli_real_connect -- but does Zend allow that?.
Posted 1 year ago # -
At the time of writing, Zend_Db doesn't supports the socket option in mysqli_real_connect. Bug: http://framework.zend.com/issues/browse/ZF-4773
I don't know if you have hand on your server but after some research, I believe you can change the configuration in your php.ini.
If you don't have access to php.ini, you should try adding on top of PHP. I'm not sure, but top of dist/site.php can be a good place for that.
ini_set('mysql.default_socket','/path/to/real/socket.sock');
Posted 1 year ago # -
Still unlucky :-(
ini_set in dist/site.php seems to work, as ini_get gives me the correct value,
but Zend keeps on complaining about not being able to connect to /tmp/mysql.sock, obviously ignoring the mysql.default_socket parameter...I got it working though: in order to lure Zend into using TCP instead of SOCKET, I used the external IP adress of my server instead of localhost.
The problem is: it required my sysadmin to allow me to connect from the "outside", which is a security concern. Furthermore, it must be slightly less efficient than using localhost.
Nevertheless, it is a workaround until Zend (and ladistribution ;) support custom socket.
Thanks for the very reactive support.
Posted 1 year ago # -
Found the best solution:
in .htaccess file, add the following linesphp_value mysql.default_socket "/var/run/mysqld_users/mysqld.sock"
php_value mysqli.default_socket "/var/run/mysqld_users/mysqld.sock"(the equivalent must exist for setting a port, or any other default parameter).
So no need to patch Zend :)Posted 1 year ago #
Reply
You must log in to post.