Website's won't load if they use a database - major problem, please help!

9 posts / 0 new
Last post
#1 Sun, 08/11/2013 - 05:22
richpig

Website's won't load if they use a database - major problem, please help!

Hi

I really hope someone can help me with his, I have checked my server this morning and all appears find but when looking at any Joomla websites I see this message:

mark('afterLoad') : null; // Instantiate the application. $app = JFactory::getApplication('site'); // Initialise the application. $app->initialise(); // Mark afterIntialise in the profiler. JDEBUG ? $_PROFILER->mark('afterInitialise') : null; // Route the application. $app->route(); // Mark afterRoute in the profiler. JDEBUG ? $_PROFILER->mark('afterRoute') : null; // Dispatch the application. $app->dispatch(); // Mark afterDispatch in the profiler. JDEBUG ? $_PROFILER->mark('afterDispatch') : null; // Render the application. $app->render(); // Mark afterRender in the profiler. JDEBUG ? $_PROFILER->mark('afterRender') : null; // Return the response. echo $app;

Wordpress sites are just blank

And Magento sites:

Whoops, it looks like you have an invalid PHP version. Magento supports PHP 5.2.0 or newer. Find out how to install Magento using PHP-CGI as a work-around.

'; exit; } /** * Error reporting / error_reporting(E_ALL | E_STRICT); /** * Compilation includes configuration file */ define('MAGENTO_ROOT', getcwd()); $compilerConfig = MAGENTO_ROOT . '/includes/config.php'; if (file_exists($compilerConfig)) { include $compilerConfig; } $mageFilename = MAGENTO_ROOT . '/app/Mage.php'; $maintenanceFile = 'maintenance.flag'; if (!file_exists($mageFilename)) { if (is_dir('downloader')) { header("Location: downloader"); } else { echo $mageFilename." was not found"; } exit; } if (file_exists($maintenanceFile)) { include_once dirname(FILE) . '/errors/503.php'; exit; } require_once $mageFilename; #Varien_Profiler::enable(); if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) { Mage::setIsDeveloperMode(true); } #ini_set('display_errors', 1); umask(0); / Store or website code / $mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : ''; / Run store or run website */ $mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store'; Mage::run($mageRunCode, $mageRunType);

Static websites (no databases) are working fine.

Everything was fine yesterday, I am running the Atomic repo with PHP 5.4.17 but this was updated several days ago and all seemed to be fine.

I'm running Virtualmin 4.01, when I check Re-check configuration everything reports back that its all ready. I can't find any errors in the error logs and am no completely lost?!

Does any one have any ideas?

Sun, 08/11/2013 - 06:49
Locutus

This sounds like a complex one to debug without further information about your system... Anything in the syslog or Apache's error log between the point when it still worked and when you noticed it had stopped working? Something must have happened during that time. Apache restart maybe, or another update, or something.

Sun, 08/11/2013 - 07:17 (Reply to #2)
richpig

Thanks Locutus, not solved but having checked back through the apache error log, from last Sunday through to this morning there are loads of these

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/apc.so' - /usr/lib/php/modules/apc.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/apc.so' - /usr/lib/php/modules/apc.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/apc.so' - /usr/lib/php/modules/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/apc.so' - /usr/lib/php/modules/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0 PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0 PHP Warning: PHP Startup: memcache: Unable to initialize module Module compiled with module API=20090626 PHP compiled with module API=20100525 These options need to match in Unknown on line 0

Nothing else with dates, just these.

I updated PHP to 5.4.17 about a week ago so I wonder if there is an incompatiblity...will keep checking but if you have any further ideas they'd be much appreciated.

Sun, 08/11/2013 - 08:28
Locutus

The error messages sound like a problem with the PHP caches APC and memcache that you have installed... How exactly did you update PHP? Usually when you update it through regular Linux means, it should either also show you updates for PHP packages like APC, or not cause problems like this.

What distro are you using? Are you using third-party repositories?

Sun, 08/11/2013 - 08:50 (Reply to #4)
richpig

Its Centos 6.4 and yes using the Atomic Repo to get a newer PHP version.

Sun, 08/11/2013 - 09:20
andreychek

Howdy,

Installing PHP from a third party repo may have caused the issue you're seeing.

What output do you receive if you run this command:

grep SetHandler /etc/httpd/conf.d/*

If you see any SetHandler lines in there which are configuring the .php extension, that may mean that the new PHP version has configured Apache in a way that's not compatible with your setup.

What you can do is comment out those SetHandler lines, and then restart Apache.

-Eric

Sun, 08/11/2013 - 09:37 (Reply to #6)
richpig

This is what I get from running the grep:

/etc/httpd/conf.d/perl.conf:# SetHandler perl-script /etc/httpd/conf.d/perl.conf:# SetHandler perl-script /etc/httpd/conf.d/php.conf: SetHandler application/x-httpd-php /etc/httpd/conf.d/php.conf:# SetHandler application/x-httpd-php-source

I've tried commenting out the php (3rd line) and now am seeing the following when loading a website:

Error displaying the error page: Application Instantiation Error

Will try commenting out the others too.

Sun, 08/11/2013 - 09:53 (Reply to #7)
richpig

Thank you so much for your help guys, after commenting out the SetHandler the next error pointed me to missing php-mysql, so I ran

yum install -y php php-mysql

Sites are now coming back! Still one or two issues, but its looking much better than it was for most of the day!

Thank you again

Sun, 08/11/2013 - 22:05
andreychek

Super, I'm glad commenting out those lines helped!

You'd want to be careful enabling third party repos -- they can often times have packages that cause disruption when being installed onto a live system. You may want to just pull in the packages you need from that repo, rather than leaving it enabled for all packages.

If you're seeing any other issues with your websites/PHP though, feel free to let us know what error(s) you're seeing and we'll do our best to help.

-Eric

Topic locked