Mysql module.. confused =/
Lo all,
Firstly, my system consists of Slack 10 Apache 2.0.50 Mysql 4.0.20 php-apache2 4.3.8 (from linuxpackages.net) Everything used to work on my system, untill i tried upgrading to php 5, then downgrading back to php 4.3.8., where mysql doesn't want to work anymore from php. (eg, phpbb). After checking around, i noticed mysql is not showing in phpinfo() (see for yourself if you want at http://xushi.co.uk/test.php ). After reading some of the threads in LQ (especially the ones which tell of the difference between php4 and php5) it just confused me a bit more... Does anyone know how to just allow apache<>php to interact with mysql again? or to load the mysql module once more? On a side note, someone suggested to revert back to apache 1.3, because 2 is still experimental, or something like that... Do you all recommend to roll back, or to stick to the current versions i have? Thank you please =) |
Frankly, I would recommend you to use mysql, php, apache from official slackware packages, they are stable and can be used in a production environment.
Specially for servers, I always use official packages for my part and I installed one time Apache 2 proprely, compiling it myself with good options, and I noticed no additional performances so I use Apache 1.3 from official package for now. |
hmm, still i'd like to solve the problem before reverting back to slackware's preffered versions.
It seems like a good idea, especially when swaret screwes up everything everytime mysql or apache gets updated. |
Help guys, i'm really confused now... i reinstalled apache, and php-apache2 (this one http://www.linuxpackages.net/pkg_details.php?id=3904 ) (configured with mysql '--with-mysql=shared,/usr' ) , but if you look in
http://xushi.co.uk/test.php it still wont display mysql there. Mysql is installed and running, if i ps -ef, its there (10 of them) 00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/xushi.pid --skip-locking --port=3306 --socket=/tmp/mysql.sock as well as 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/xushi.pid I don't know what i'm missing.. but it seems like its something small and very irritating. Any help is appreciated. |
What is the output for :
Code:
php -r 'echo mysql_connect();' |
The output:
PHP Fatal error: Call to undefined function: mysql_connect() in Command line code on line 1 And from the tone of it i guess it meens bad news... heh excuse linda (my box's name)... she's been lonley for a few months =) |
Thanks Cedrik, i used the error i got from your code as a base for my search, and it led me to get the answer =)
For all you out there who have the same problem, it usually happens when you upgrade or reinstall php (or php-apache2) firstly you need to add the line in php.ini extension=mysql.so if its not there... (search for it). I didn't have it, and that was the main problem. secondly locate where mysql.so is (incase you start getting errors when starting up apache), locate mysql.so mine was in /usr/lib/php/extensions edit /etc/apache2/php.ini and edit the line to look like extension_dir = "/usr/lib/php/extensions/" Thats it. Thanks for the tips everyone, and hope this helps. |
Just wanted to add something I discovered the last days which is a quite similar problem.
I had a fresh install of Slackware 10 with precompiled Apache 1.3.31 and PHP 4.3.7 (added those packages during installation). I dowloaded the MySQL binaries and started Apache and the MySQL server. The settings xushi postet were set exactly that way. Even though phpinfo() doesn't show MySQL. The problem was that the precompiled PHP used static libraries while the MySQL binaries used dynamic ones. The solution was to download the MySQL sources, ./configure with --enable-shared and compile. Works great then... Maybe that helps someone... |
All times are GMT -5. The time now is 09:50 AM. |