From: Charles S. <ch...@st...> - 2002-03-19 18:22:59
|
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 upgrading: /usr/local/lib/phpwiki-1.3.2/lib/FileFinder.php:82: Fatal[256]: DB.php: file not found 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: ini_set('include_path', '/usr/share/pear/'); At this point, you'll get another error, this time something like: /usr/local/lib/phpwiki-1.3.2/lib/WikiDB/backend/PearDB.php:27: Fatal[256]: 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 back online... Hopefully, this will save someone else the hassle I went through figuring this out... Charles Steinkuehler ch...@st... |