php - phpbrew not connecting to mysql -
i have set phpbrew, including installing requirements , have compiled php-5.6.11 using following command:
sudo phpbrew --debug install php-5.6.11 +default+mysql+pdo+debug +apxs2 -- --with-mysql-sock=/var/run/mysqld/mysqld.soc
i can switch between php versions using phpbrewswitch script below, found in this comment:
#!/usr/bin/env bash version=$1 sofile=/usr/lib/apache2/modules/libphp$version.so conffile=/etc/apache2/mods-available/php5.load source ~/.phpbrew/bashrc if [ -f $sofile ]; phpbrew switch $version phpbrew list filecontents="loadmodule php5_module $sofile" echo $filecontents > $conffile echo "updated $conffile" sudo service apache2 restart else echo $version "is not configured apache" phpbrew list fi
this script uses phpbrew switch php versions , tells apache use .so file requested version, reboots apache. (all in 1 commmand makes easy switch & forth yay!)
however switching between local php 5.6.11 installation , phpbrew 5.6.11 install causes mysql stop connecting. phpinfo runs fine on both versions , displays relevant info, fyi. missing? there in php.ini make mysql work? parameter i'm missing when compiling phpbrew? advice appreciated, working.
i figured out. turns out mysql host variable in php scripts set "localhost". explicitly setting "127.0.0.1" did trick. not sure why localhost wasn't resolving whatevs. works! xd
Comments
Post a Comment