As outlined in a previous question (https://stackoverflow.com/questions/21648349/php-5-5-9-test-failures-and-internal-server-errors) my server administrator recently tried to install php 5.5.9 (using a wrapper) alongside our current configuration, which is php 5.3.8. The o/s is Opensuse 12.1, and it's a Plesk server (11.0.9).
After a successfull installation and initiating the new configuration on a specific vhost, every php script throws out a 500 Internal Server Error. The Apache logs do not show any useful information, however we were able to get mod_sec to pickup a fastcgi error which is as follows:
**Apache-Error:
[file "fcgid_proc_unix.c"] [line 634] [level 4] [status 104] mod_fcgid: error reading data from FastCGI server
Apache-Error: [file "util_script.c"] [line 435] [level 19] Premature end of script headers: db.php**
This error appears only when 5.5.9 is active, and disappears as soon as we switch back to 5.3.8. This is the only lead we have to go on :(
We've also tried checking htaccess & permissions, so far no change.
Thanks!
Problem solved, finally.
In our case we had to CHMOD the cgi-bin for the vhost to 755 (it was 775). After that, smooth running!
Related
I have a weird situation where Wordpress PHP some errors are not showing up neither in my MAMP error logs, nor in my per-host error log.
When I tail -f /Application/MAMP/logs/*error* the MAMP error logs I see:
[Wed Apr 18 00:18:23 2018] [error] [client ::1] FastCGI: incomplete headers (0 bytes) received from server "/Applications/MAMP/fcgi-bin/php5.4.45.fcgi"
Nothing when I tail -f <local-site-host-path>/*error* I see no updates whatsoever, even tho I have added a php.ini and .user.ini (just in case) to log errors, have chmod 777 all error_log files, and have this in both .ini files:
log_errors = On
error_reporting = 8589934592
error_log = /<local-site-host-path>/error_log
display_errors = 1
NOTES:
if I intentionally make a PHP code typo, I see the errors in the MAMP logs but not in the host logs.
MAMP installed on a Macbook,
Running a few Wordpress sites (latest 4.9.5) with all plug-ins up to date) (error is not showing up for all of them).
The actual 500 server error is happening ƒor /wp-admin/* ONLY for a site (wp 4.9.5) and partially for another site (wp 4.9.5); Yet a third site's /wp-admin/* (wp 4.9.2) works just fine (!?!?!?)
Or am I being hacked (as Ripul Kumar points out here, but with no further information on what symptoms were present that showed him he was hacked: MAMP Pro doest no log PHP errors) => I ACTUALLY REINSTALLED MAMP + MAMP Pro to see if that made any difference. NO, it didn't. EXACT SAME result.
THANK YOU
I've been away from Laravel/Unix for some time but I have a project to setup and hit some snags. The most recent version of Laravel required PHP >=5.6 so I got that updated, setup my new project with laravel new project and made some modifications to the user/group permissions for storage/ and bootstrap/cache folders as normal.
I'm getting HTTP/500 error from Nginx so I checked the error log and I'm getting this in /var/log/nginx/error.log:
FastCGI sent in stderr: "PHP Message: PHP Fatal Error: Class PDO not found in /home/user/public_html/project/config/database.php on line 16" while reading upstream ... upstream: "fastcgi://unix:/var/run/php5-fpm.sock"
PHP Version 5.6.28-1~dotdeb+7.1
When I check /etc/php5/fpm/php.ini the normal extension=pdo.so and extension=pdo_mysql.so were not there so I added them to test it, however those are being requested in the conf.d folder and PHPINO shows those files being scanned/loaded.
However, later in PHPINFO results, PDO/PDO_MYSQL is not listed
UPDATE
I just attempted to use find /-name pdo.so and the same for pdo_mysql.so to find the path to those files and manually modified the loading configuration files to point to them correctly, started the server and that doesn't change anything.
I apologize this is long. I've spent a couple hours scouring to make sure I wasn't just missing something silly, and I may still be.
Any ideas overlfowers?
Well, after much consternation and fiddling I figured this one out...
There was a recursive / endless loop being created in the php-fpm.conf config as shown here:
include=/etc/php5/fpm/*.conf
This was causing PHP5-FPM .conf to attempt including itself, which I caught in a bootup error: Failed to load configuration file /etc/php5/fpm/php-fpm.conf from /etc/php5/fpm/php-fpm.conf
So I modified that to include=/etc/php5/fpm/conf.d/*.conf and everything started back up and now PDO/PDO_MSYQL is loading.
I configured piwik php code to my apache tomcat server using java-bridge and php-servlet api,
It is working fine for the local environment with window, but while same thing done on test environment, There also working fine but after some time it is falling and giving following exception :
If anyone having the same experience please help me to get it out.
type Exception report
message PHP FastCGI server not running. Please see server log for details. Or start a PHP FastCGI server using the command:
description The server encountered an internal error that prevented it from fulfilling this request.
exception
java.io.IOException: PHP FastCGI server not running. Please see server log for details. Or start a PHP FastCGI server using the command:
cd /liferay-portal-6.2-ee-sp7/tomcat-7.0.42/webapps/piwik/WEB-INF/cgi/amd64-linux
REDIRECT_STATUS=200 X_JAVABRIDGE_OVERRIDE_HOSTS="/" PHP_FCGI_CHILDREN="5" PHP_FCGI_MAX_REQUESTS="5000" /usr/bin/php-cgi -b 127.0.0.1:9668
php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:489)
php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)
root cause
java.io.IOException: PHP FastCGI server failed:
php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:439)
php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)
root cause
php.java.bridge.http.FCGIConnectException: Could not connect to server
php.java.bridge.http.SocketChannelFactory.doConnect(SocketChannelFactory.java:77)
php.java.bridge.http.SocketChannelFactory.connect(SocketChannelFactory.java:88)
php.java.servlet.ContextLoaderListener$1.connect(ContextLoaderListener.java:533)
php.java.bridge.http.FCGIConnectionPool$Connection.reopen(FCGIConnectionPool.java:101)
php.java.bridge.http.FCGIConnectionPool.openConnection(FCGIConnectionPool.java:224)
php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:312)
php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:433)
php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)
root cause
java.net.ConnectException: Connection refused
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
java.net.Socket.connect(Socket.java:579)
java.net.Socket.connect(Socket.java:528)
java.net.Socket.<init>(Socket.java:425)
java.net.Socket.<init>(Socket.java:241)
php.java.bridge.http.SocketChannelFactory.doConnect(SocketChannelFactory.java:75)
php.java.bridge.http.SocketChannelFactory.connect(SocketChannelFactory.java:88)
php.java.servlet.ContextLoaderListener$1.connect(ContextLoaderListener.java:533)
php.java.bridge.http.FCGIConnectionPool$Connection.reopen(FCGIConnectionPool.java:101)
php.java.bridge.http.FCGIConnectionPool.openConnection(FCGIConnectionPool.java:224)
php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:312)
php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:433)
php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.
Apache Tomcat/7.0.42
Thanks!
Surendra
i have a VPS mounted with RedHat OS. Today, install DAV module for Apache from WHM and the services was restated.
Apache works fine, but PHP has troubles. All my php scripts return 501 Internal Server Error.
In the log /usr/local/apache/logs/error_log i can see:
[error] [client 190.247.67.31] Premature end of script headers:
info.php
And PHP command line doesn't work. When i try php -v the command doesn't show the PHP version and nothing is returned.
Note: PHPMyAdmin works.
Any ideas ?
In my case the problem was an incorrect php.ini configuration.
I had a LAMP application running wordpress and I deleted the whole directory and replaced with new files - php based.
Now, when I go to view my server running CentOS - it just shows a 500 Internal Server error.
I've tried:
restarting server
restarting apache service itself
both completed successfully, but this didn't fix anything. Now, I do not know where to go from here.
apache logs # /usr/local/apache/logs/error_log on apache:
[Tue Apr 22 11:12:15 2014] [error] [] SoftException in Application.cpp:357: UID of script "index.php" is smaller than min_uid
I found the fix myself, this wasn't an error with Mysql at all, but rather a permissions issue with the index.php file I had.
The error, which I found in /usr/local/apache/logs/error_log was:
:is smaller than min_uid Premature end of script headers: index.php
To fix, I did this:
ls -l in the directory causing the issue (mine was public_html)
You should see the index file (e.g. index.php) that should be causing the issue. It is due to a root user having the only permission to the file and not your CPanel (or system) username. (note this system/cpanel name)
Run the following within the errorneous directory(Note: this command must be run within all subdirectories of the primary errorneous directory.):
sudo chown yoursystemuserhere:yoursystemgroupuserhere index.php
or to apply to the whole directory (thanks to #Prix):
sudo chown -R user:group /folder
You're all set.
Further literature here: http://www.inmotionhosting.com/support/website/general-server-setup/uid-smaller-than-min-uid
I hope this helps someone else in the future.
I had similar symptoms on my cPanel VPS - I was able to use easyApache to recompile Apache and PHP which fixed the problem for me.
(I realise my problem was slightly different to yours, but it may be helpful for people in the future who have the same problem I had).
chown -R user.usergroup /path_to_the_directory
Will resolve this. It is basically permission issues.
just install wordpress latest version make sure you have atleast php version 5.3 and above also look global register variable if it off or just delete htacess file from server and see what will happens
generally 500 internal server gives when file permission is missing so you should delete htacess file