Magento/PHP 500

I am suddenly getting 500 error on a Magento installation which was doing well for a long time.

When I tried to test install another instance of Magento, I got this error.

Downloading http://scripts.virtualmin.com:80/magento-1.9.2.4.tar.gz (23.14 MB) .. Received 1024 bytes (0 %) Received 2.31 MB (10 %) Received 4.63 MB (20 %) Received 6.94 MB (30 %) Received 9.26 MB (40 %) Received 11.57 MB (50 %) Received 13.89 MB (60 %) Received 16.20 MB (70 %) Received 18.52 MB (80 %) Received 20.83 MB (90 %) Received 23.14 MB (100 %) .. download complete.

PHP module mysql is required .. Installing package php5-mysql .. Installing package(s) with command /bin/yum -y install php5-mysql .. Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirror.eboundhost.com * epel: mirror.utexas.edu * extras: dallas.tx.mirror.xygenhosting.com * updates: mirror.scalabledns.com No package php5-mysql available. Error: Nothing to do .. install failed! Module is not available even after installation!

Appreciate help.

Update: php -v PHP 5.4.16 (cli) (built: May 12 2016 13:45:17) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with XCache v3.1.1, Copyright (c) 2005-2014, by mOo with Zend OPcache v7.0.5, Copyright (c) 1999-2015, by Zend Technologies with Xdebug v2.2.7, Copyright (c) 2002-2015, by Derick Rethans with XCache Optimizer v3.1.1, Copyright (c) 2005-2014, by mOo with XCache Cacher v3.1.1, Copyright (c) 2005-2014, by mOo with XCache Coverager v3.1.1, Copyright (c) 2005-2014, by mOo

Status: 
Active

Comments

Howdy -- if you're receiving a 500 error, that indicates that there is an error message being placed into that website's error log.

What message do you see if you look in $HOME/logs/error_log?

bislinks's picture
Submitted by bislinks on Fri, 06/03/2016 - 09:11 Pro Licensee

[Fri Jun 03 10:09:15.988588 2016] [cgi:error] [pid 11163] [client 192.168.1.76:62894] AH01215: PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0 [Fri Jun 03 10:09:15.989320 2016] [cgi:error] [pid 11163] [client 192.168.1.76:62894] AH01215: PHP Warning: Module 'mysql' already loaded in Unknown on line 0 [Fri Jun 03 10:09:16.084733 2016] [cgi:error] [pid 11163] [client 192.168.1.76:62894] AH01215: Unable to open logfile '/var/log/zarafa/php-mapi.log' as user 'hostlawn' [Fri Jun 03 10:09:16.087495 2016] [cgi:error] [pid 11163] [client 192.168.1.76:62894] AH01215: Not enough permissions to append logfile '/var/log/zarafa/php-mapi.log'. Reverting to stderr. [Fri Jun 03 10:09:16.186916 2016] [cgi:error] [pid 11163] [client 192.168.1.76:62894] AH01215: PHP Fatal error: Directive 'magic_quotes_gpc' is no longer available in PHP in Unknown on line 0 [Fri Jun 03 10:09:16.199074 2016] [cgi:error] [pid 11163] [client 192.168.1.76:62894] End of script output before headers: php5.cgi

It looks like the permissions on your log files have changed.

That's not a standard directory for logging, so I'm not quite sure what might have changed the permissions.

However, the key to resolving it would be to review the permissions of /var/log/zarafa/ and /var/log/zarafa/php-mapi.log, and to make sure the user "hostlawn" has permission to write to them.

bislinks's picture
Submitted by bislinks on Fri, 06/03/2016 - 10:00 Pro Licensee

Oops, I do not know what this "zarafa" is and how it got into my server. If you know what it is, let me know how to get rid of it. Probably, I did some update/installation to get it in. Is it a CentOS7 thingy?

ls -aL /var/log/zarafa . ..

But whereis zarafa gave me the following output.
zarafa: /etc/zarafa /usr/share/zarafa /usr/share/man/man1/zarafa.1.gz

ls /etc/zarafa php-mapi.cfg

And here is the output of cat /etc/zarafa/php-mapi.cfg

##############################################################
# LOG SETTINGS

# Logging method (syslog, file), syslog facility is 'mail'
log_method              = syslog

# Logfile (for log_method = file, '-' for stderr)
#log_file               = /var/log/zarafa/php-mapi.log

# Loglevel (0=no logging, 5=full logging)
log_level               = 5

# Log timestamp - prefix each log line with timestamp in 'file' logging mode
#log_timestamp          = 1

I'm unfortunately not familiar with Zarafa, though it does appear to be the cause of the problems you are seeing.

If you don't need it, I'd review your various Apache config files for any reference to it, and get rid of it.

Alternatively, you could always just create the directory it's looking for and make it owned by that user, so that it can create the log file it wants.