Submitted by SteveAcup on Thu, 10/08/2009 - 15:04
I migrated my virtual domains from an old centos server to a new centos 5.3 server Linux 2.6.18-164.el5 on x86_64. The new server is a clean install from script. I restored the domains from a new backup of the old server domains. The users and web pages all transferred properly, but scripts using mysql are failing. (webcalendar, phpbb and one of the help desk scripts.) After a little diggind, it appears that all the old scripts fail when accessing mysql.
I created a new webcalendar in another domain, and it works correctly.
Is there a known issue with backups? Hopefully there is something simple I've missed.
thanks... Steve
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Thu, 10/08/2009 - 16:04 Comment #1
I haven't seen this before .. backups should transfer mysql data and logins across just fine, unless you have manually changed mysql passwords outside of Virtualmin.
What error are you getting exactly?
Submitted by SteveAcup on Thu, 10/08/2009 - 16:05 Comment #2
Fixed....
On the old system Server Configuration / website options / PHP script execution mode was set to FCGId
On the new system, I had to change that to Apache mod_php (run as Apache's user)
scripts all work now with the setting change.
Submitted by JamieCameron on Thu, 10/08/2009 - 16:07 Comment #3
Hmm, that's odd .. unless the new system has a different PHP version installed, or different modules.
Submitted by SteveAcup on Thu, 10/08/2009 - 16:08 Comment #4
On the script web pages, I would get no error at all... just a blank screen
When tracing the php execution, it would hang whenever a db function call was made.
We can probably recreate the problem for you, but we had to get the production stuff back online ASAP so I just changed it all to apache mod_php to get it up.
Submitted by SteveAcup on Thu, 10/08/2009 - 16:22 Comment #5
perhaps apache was not running as the correct user?
My phpbb was a little messed up still. I had to set the .cache folder to 777 so that the program would run.
webcalendar ran fine when mod_apache was selected.
osticket runs fine with mod_apache
Sorry didn't do a rigorous troubleshooting, we were in a hurry to get it back online.
Submitted by JamieCameron on Thu, 10/08/2009 - 17:01 Comment #6
If you switch to mod_php mode, scripts will run as a different Unix user, and so may not be able to access directories that they were before (such as the cache folder).
Submitted by SteveAcup on Thu, 10/08/2009 - 17:12 Comment #7
That explains why the cache needed permissions changed, but doesn't explain the original problem that we had to fix by changing from FCGId to mod_php.
What is the standard you suggest we use - mod_php or FCGId? Now that they are working, I can try tweaking settings to get it right.
Submitted by JamieCameron on Thu, 10/08/2009 - 17:14 Comment #8
I recommend using fcgid , as it improves security by preventing scripts run by one domain from accessing files owned by another.
Submitted by SteveAcup on Thu, 10/08/2009 - 17:50 Comment #9
OK... I set up a new script in one of my virtual servers and it set up as mod_php by default, and it worked. When I switched it to FCGId it failed - blank screen when starting the script.
Template for domain is set to use FCGId, but it doesn't. I'm looking for a missing setting somewhere....
remember, this is a clean install on CentOS from install script.
Submitted by JamieCameron on Thu, 10/08/2009 - 17:51 Comment #10
Which PHP script were you trying to run ?
Does it log anything useful to ~/logs/error_log ?
Submitted by SteveAcup on Thu, 10/08/2009 - 18:09 Comment #11
I've been using webcalendar as a simple canary. It has installed a few times successfully, but now it gives this error when I attempt to install.
found http://prdownloads.sourceforge.net:80/sourceforge/webcalendar/WebCalenda... in cache ..
PHP module mysql is required ..
Module is not available even after installation!
<- Return to list of scripts
If I change website settings back to mod_php it installs. looks like the php5-mysql is required for the FCGId but not available?
Submitted by JamieCameron on Thu, 10/08/2009 - 18:29 Comment #12
Does it help if you run
yum install php-mysql
from the command line first ?What's odd is that Virtualmin should do this automatically ..
Submitted by SteveAcup on Fri, 10/09/2009 - 08:03 Comment #13
That's actually one of the first things I tried.
yum install php-mysql Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.cs.vt.edu * updates: centos.aol.com * addons: centos.aol.com * extras: centos.mirror.nac.net Setting up Install Process Parsing package install arguments Package php-mysql-5.1.6-23.2.el5_3.x86_64 already installed and latest version Nothing to do
Looks like a summary of repeatable symptoms are:
It appears that I cannot install the webcalendar script when website options are set to FCGId due to a missing php5-mysql, but I can install webcalendar when website options are set to mod_php.
Domains restored from backup were originally installed on a FCGId machine, and they get restored but do not work unless we change them to mod-php.
Other scripts show the same behavior: osticket & phpbb.
Submitted by JamieCameron on Fri, 10/09/2009 - 12:40 Comment #14
That's odd, as it indidcates that the php-mysql package is already installed, so MySQL support should be working already.
If you edit etc/php5/php.ini under the domain's home directory, is there a line like :
extension=mysql.so
Submitted by SteveAcup on Mon, 10/12/2009 - 14:56 Comment #15
Yes, extension=msql.so is in the php ini file.
Additional symptom.... this cgi file does not run in /cgi-bin .and gives a 500 Internal Server Error:
file: php5.cgi
!/bin/bashPHPRC=$DOCUMENT_ROOT/../etc/php5 export PHPRC umask 022 SCRIPT_FILENAME=$PATH_TRANSLATED export SCRIPT_FILENAME exec /usr/bin/php-cgi
Submitted by JamieCameron on Mon, 10/12/2009 - 15:03 Comment #16
You can't run that cgi script directly .. it is used to run PHP scripts.
You should verify that the mysql.so module is being loaded properly. Try SSHing in as the domain owner user, and running :
export PHPRC=/home/domain/etc/php5
php-cgi -m
and post the output..
Submitted by SteveAcup on Tue, 10/13/2009 - 16:48 Comment #17
I'm messing up a lot recently. Thought that was one of the generic status utilities. Here's the results of the commands for domain & user bvwisp.net with domain settings to: Apache mod_php (run as Apache's user)
-sh-3.2$ export PHPRC=/home/bvwisp.net/etc/php5
-sh-3.2$ php-cgi -m
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysql.so' - /usr/lib/php/modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/dbase.so' - /usr/lib/php/modules/dbase.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/gd.so' - /usr/lib/php/modules/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/imap.so' - /usr/lib/php/modules/imap.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/ldap.so' - /usr/lib/php/modules/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mbstring.so' - /usr/lib/php/modules/mbstring.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysql.so' - /usr/lib/php/modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysqli.so' - /usr/lib/php/modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/odbc.so' - /usr/lib/php/modules/odbc.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo.so' - /usr/lib/php/modules/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_mysql.so' - /usr/lib/php/modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_odbc.so' - /usr/lib/php/modules/pdo_odbc.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_pgsql.so' - /usr/lib/php/modules/pdo_pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_sqlite.so' - /usr/lib/php/modules/pdo_sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pgsql.so' - /usr/lib/php/modules/pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/snmp.so' - /usr/lib/php/modules/snmp.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/xmlrpc.so' - /usr/lib/php/modules/xmlrpc.so: cannot open shared object file: No such file or directory in Unknown on line 0 [PHP Modules] bz2 calendar ctype curl date exif ftp gettext gmp hash iconv libxml mime_magic openssl pcntl pcre posix pspell Reflection session shmop SimpleXML sockets SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml zlib
[Zend Modules]
-sh-3.2$
Submitted by JamieCameron on Tue, 10/13/2009 - 19:48 Comment #18
Sounds like a bunch of files are missing .. what is the output from :
rpm -V php-mysql
if it reports missing files, try running :
rpm -e --nodeps php-mysql
yum install php-mysql
Submitted by SteveAcup on Wed, 10/14/2009 - 08:27 Comment #19
rpm -V php-mysql
executes but gives no output.
I ran the command as both domain owner and root, no output from either.
Should I create a login account for you?
This box is:
Operating system CentOS Linux 5.3 Webmin version 1.490
Virtualmin version 3.73 Pro Theme version 7.4
Time on server 14/Oct/2009 08:57 Kernel and CPU Linux 2.6.18-164.el5 on x86_64
Real memory 5.82 GB total, 1.27 GB used [Memory used] Virtual memory 5.81 GB total, 0 bytes used [Swap space used] Local disk space 1.32 TB total, 79.21 GB used [Disk space used]
Submitted by JamieCameron on Wed, 10/14/2009 - 12:35 Comment #20
Sure, a login account would be great! You can email me the details at jcameron@virtualmin.com
Submitted by JamieCameron on Mon, 10/19/2009 - 13:47 Comment #21
Ok, thanks for the login .. I see the issue now. Your old system was 32-bit but the new is 64-bit, and PHP puts its modules in a different directory for different CPU types. And your domains' php.ini files were all referring to the 32-bit path.
The quick fix was to run :
cd /usr/lib
ln -s /usr/lib64/php .
/etc/init.d/httpd restart
try it now ..
Submitted by SteveAcup on Sun, 10/25/2009 - 17:37 Comment #22
Thanks.... you guys kick butt.
Submitted by JamieCameron on Sun, 10/25/2009 - 22:02 Comment #23
Glad to help!
Submitted by Issues on Mon, 11/09/2009 - 17:19 Comment #24
Automatically closed -- issue fixed for 2 weeks with no activity.