LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Upgrade to MySQL-5.0.18 breaks PHP mysql functions (http://www.linuxquestions.org/questions/slackware-14/upgrade-to-mysql-5-0-18-breaks-php-mysql-functions-425535/)

MarkVickers 03-16-2006 06:39 PM

Upgrade to MySQL-5.0.18 breaks PHP mysql functions
 
I need to run mysql5 on a Slackware 10.2 box (with all latest security patches).

I've done the following...
upgradepkg mysql-5..18-i486-1.tgz
upgradepkg apache-1.3.34-i486-2.tgz
upgradepkg db4-4.2.20-i486-1.tgz
which seems to have cured most problems but I cannot now access mysql from within a php web page. I get the following error when apache starts...

PHP Warning: Unknown(); Unable to load dynamic library '/usr/lib/php/extensions/mysql.so' - libmysqlclient.so.14: cannot open shared object file: No such file or directory in Unknown on line 0

This seems to indicate that the php-4.4.2-i486-3 package is expecting mysql4 not mysql5.

Anyone had the same problem and found a work around or know what I need to recompile?

Thanks for any help,
Mark

willysr 03-16-2006 07:51 PM

try compiling PHP from source and add --with-mysql=/path/to/MySQL
it worked for me :D

MarkVickers 03-17-2006 04:12 AM

Thanks willysr, tried that but the compiled php4 didn't work very well. Not sure what I did wrong yet. :confused:
However, have discovered a working upgrade path using packages in slackware-current. It does use the php5 in /testing but that seems to be working on everything I've tried as yet.

Upgrade went as follows...
*upgragepkg mysql-5.0.18-i486-1.tgz
*upgradepkg apache-1.3.34-i486-2.tgz
*upgradepkg db4-4.4.20-i486-1.tgz
*upgradepkg php-5.1.2-i486-2.tgz
*installpkg openldap-client-2.3.17-i486-1.tgz
*modified /etc/mod_php.conf to LoadModule php5_module libexec/apache/libphp5.so instead of php4

I now have a working mysql5 and php5 web server! :D

willysr 03-17-2006 04:20 AM

congratulations, but it strange that it worked for me and didn't for you. Perhaps you missed some parameter. What kind of parameter did you have on your configure script??

xenon2000 05-02-2006 10:22 AM

MySQL 5 with PHP 5
 
I just did this on Slackware 10.2 (su or logged in as root for all this)

99% of the time I manually install via configure, make, make install. Usually I have been following the latest Apache and PHP, and using MySQL 4.1.x. But have decided to make the jump to MySQL 5.0.x

On a new server, I manually installed Apache 2.0.55 (Often use 2.2.x as well)

./configure --prefix=/usr/local/apache2 --enable-so --enable-ssl
make
make install
edit your httpd.conf (Sorry I am not covering this in detail here.)

Then I tried manually compiling MySQL 5.0.20a and also tried the general linux binary, but couldn't get php5 to compile with support for it working. So I broke down and found the slackware package for it.

installed mysql-5.0.20a-i486-1.tgz using pkgtool

then followed these post install instructions: http://dev.mysql.com/doc/refman/5.0/...tallation.html

Which is basically:

bin/mysql_install_db --user=mysql
bin/mysqld_safe --user=mysql &

check that it's running and connection works:
bin/mysqladmin version

setup a password
/bin/mysqladmin -u root password 'newpassword'

If these steps don't work, you might have to do this:
cd /var/lib/mysql
chown -R root mysql
chown -R myusername mysql
chown -R mysql mysql

Once MySQL 5.0.20a is installed and working from the package install, move on.

PHP 5.1.2 source install:
apachectl stop

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-zlib --with-bz2 --with-openssl --with-https --with-ftps --enable-mbstring
make
make install
edit your php.ini file (sorry I am not covering this in detail here)
apachectl start

Make sure Apache and MySQL are started, do a phpinfo() to make sure you see:
Client API version 5.0.20a Listed in the mysql section
Also make sure it shows the php.ini path you expect and that it shows the correct Apache version and path as well.

And to finish up, I installed phpmyadmin 2.7 (because I don't like the current 2.8 right now) and make sure phpmyadmin can connect and works. This will verify that php5 and mysql5 are working together. --enable-mbstring is so you can properly do utf-8 if you ever need to. And it keeps phpmyadmin from having a notice about mbstring not being enabled.

willysr 05-03-2006 01:10 AM

i use a source code version for my PHP and everytime there is a newer MySQL from Slackware repository, i upgrade the MySQL first and then i recompile my PHP to reflect the new MySQL library from the newer MySQL.


All times are GMT -5. The time now is 09:05 AM.