I've been running PhpWiki 1.3.2 with the mysql back-end on several RedHat
7.2 servers without much trouble, until I recently upgraded to the latest
php code via up2date (php-4.0.6-12).
No matter what I tried, I couldn't get PhpWiki to talk to mysql. I tried
various modifications to the index.php file, as well as upgrading to both
1.3.3 and the latest CVS code (March 18, 2002).
It turns out there are some problems with the latest RedHat compile of the
mysql back-end for php.
First, if you're running 1.3.2, or earlier versions that relied on the PEAR
DB code from the host system, you'll get a message like the following when
/usr/local/lib/phpwiki-1.3.2/lib/FileFinder.php:82: Fatal: DB.php: file
This is because RedHat moved the pear libraries, so they are not found by
default. To fix this, you need to add the new location of the pear files
(/usr/share/pear) to the include path:
At this point, you'll get another error, this time something like:
Can't connect to database: wikidb_backend_mysql: fatal database error
or the infamous:
Can't connect to local MySQL server through socket '/tmp/mysql.sock'
This is because the rocket scientists at RedHat compiled the mysql back-end
without mysqld running, so mysql.sock couldn't be found, resulting in the
compiled-in default pointing to /tmp/mysql.sock which doesn't exist.
The fix for this is pretty simple, however, just edit /etc/php.ini, find the
line that sets mysql.default_socket, and change it to the following:
mysql.default_socket = /var/lib/mysql/mysql.sock
Restart httpd so the change will take effect, and your phpwiki should be
Hopefully, this will save someone else the hassle I went through figuring