getting error as Internal Server error - php

When I try to run my site it gives error as Internal Server error, when I refresh the page I get my result properly.The error page looks like this:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#test.mywebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I also checked error_log file on my server, it gives error as:
[Sat Jun 12 01:21:55 2010] [error] [client 117.195.6.76] File does not exist: /home/rohit25/public_html/test/500.shtml, referer: http://www.test.mysite.com/home.php
sometimes error can be;
[Sat May 29 19:35:12 2010] [error] [client 97.85.189.208] File does not exist: /home2/carlton/public_html/test/favicon.ico
Are there any changes required in configuration file, I also tried to involve this error code in custom error page, it shows error page, which could not resolve this issue.
Your urgent help will be greatly appreciated.

The two errors you posted from your log are 404 errors. You need to configure your server to report HTTP 500 errors, which are those Internal Server Errors causing the message above.

Related

FastCGI server error 500

I have an Ubuntu virtual server where I host my php website with the newest version of Plesk 12 and PHP 5.5. Sometimes (I believe when I open pages quickly one after another), I get an Internal Server error message..
When I refresh the page, the site is normal again immediatly, but sometimes the error message dissappears after about one minute later.
this is what I get on the page:
Internal Server Error 500.
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Error log:
[fcgid:warn] [pid 26583] (104)Connection reset by peer: [client (ip
address)] mod_fcgid: error reading data from FastCGI server, referer:
(url here)
[core:error] [pid 26583] [client (ip address)] End of script output
before headers: index.php, referer: (same url here)
Given your error log it looks like the index page wanted to write an HTTP header (with either header() or set_cookie or similar) AFTER it printed regular output, in your case probably a warning message due to an interrupted connection.
What I would try to do is disable all error output in the page with the php.ini, but still log the errors.
PHP can only output HTTP header fields before any other regular output, warning and error messages on the page included. So if you direct all errors and warnings only to the log files, and NOT print them on the page, there will be no output before the HTTP header and it should work fine.
If any PHP script causes an error, try following this procedure:
Switch from FastCGI to CGI
Trigger an error with another request
Inspect error_log for actual errors, fix them accordingly
Switch back to FastCGI
If configuration files like apache.conf have an error in them it will not appear in the error log with FastCGI on.

Error 500 No Http response code found

joomla 2.5.18
php -5.4.12
apache - 2.4.4
mysql - 5.6.12 ,
I am trying to post data on particular url and get the response, Here is my code
jimport('joomla.http');
$data = array('foo' => 'bar'); //sample data array
$transport = null;
$transportWrappers=array('JHttpTransportCurl','JHttpTransportStream','JHttpTransportSocket');
$moduleParams = new JRegistry();
while (!$transport && $transportWrappers)
try{
$wrapper = array_shift($transportWrappers);
$transport = new $wrapper($moduleParams);
}
catch (Exception $e){
continue;
}
$http = new JHttp($moduleParams, $transport);
$url = 'my_url';
$response = $http->post($url,$data);
print_r($response);
I have also checked other forums with same problem , they suggested to check #_update_sites table , my table is fine, no unknown data is there .
I am unable to figure out where is the problem.I tried the same code for different url.It worked.
I dont think there is problem in my url.
Here is my apache log error
[Wed Mar 26 13:50:51.154818 2014] [:error] [pid 4504:tid 1664] [client
::1:51174] PHP 13. JHttp->post()
C:\wamp\www\joomla\components\com_name\views\abc\tmpl\default.php:70
[Wed Mar 26 13:50:51.154818 2014] [:error] [pid 4504:tid 1664] [client
::1:51174] PHP 14. JHttpTransportCurl->request()
C:\wamp\www\joomla\libraries\joomla\http\http.php:122 [Wed Mar
26 13:50:51.154818 2014] [:error] [pid 4504:tid 1664] [client
::1:51174] PHP 15. JHttpTransportCurl->getResponse()
C:\wamp\www\joomla\libraries\joomla\http\transport\curl.php:134
Please help here.
[UPDATED]
It was the Wamp version problem , i tried the same codes in Xampp and it worked.
Introduction
The Web server (running the Web Site) encountered an unexpected condition that prevented it from fulfilling the request by the client (e.g. your Web browser or our CheckUpDown robot) for access to the requested URL.
This is a 'catch-all' error generated by the Web server. Basically something has gone wrong, but the server can not be more specific about the error condition in its response to the client. In addition to the 500 error notified back to the client, the Web server should generate some kind of internal error log which gives more details of what went wrong. It is up to the operators of the Web server site to locate and analyse these logs. (Last updated: October 2013)
Fixing 500 errors - general
This error can only be resolved by fixes to the Web server software. It is not a client-side problem. It is up to the operators of the Web server site to locate and analyse the logs which should give further information about the error.
Fixing 500 errors - CheckUpDown
Our service monitors your site for HTTP errors like 500. Please contact us (email preferred) whenever you encounter 500 errors on your CheckUpDown account. We then have to liaise with your ISP and the vendor of the Web server software so they can trace the exact reason for the error. Correcting the error may require recoding program logic for the Web server software, which could take some time.

server X brings back 200 response, Server Y throws and Internal server error

I'm having an issue with a CURL reader I built (see: Premature end of script headers: php-cgi -- While running a CURL script)
The guy said to check if my problem server will speak to the feed, so I tested the below code locally and it works, tested in on the server and got an internal server error. I am lost here, how should I go about debug this as the host company are not being very helpful at all.
code:
$url = 'http://www.energydigger.com/feeds/headlines.xml';
list($status) = get_headers($url);
if (strpos($status, '200') !== FALSE) {
echo 'boom';
}
problem server response:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root#localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
all i am getting from the log they provide is:
[Wed Apr 24 20:36:01 2013] [warn] mod_fcgid: read data timeout in 60 seconds
[Wed Apr 24 20:36:01 2013] [error] [client 151.227.255.54] Premature end of script headers: php-cgi
Any advice is appreciated, as I'm a little stuck on what to do now.
Maybe I could reproduce it. But my environment uses mod_fcgid not simple cgi. Make sure the owner and group are the same as for the executing cgi user. Or for simplicity as all the other files in your webdirectory.

Internal Server Error - PHP - cPanel

I have a PHP site hosted with cPanel.
Yesterday, I changed certain directory listings (using Index Manager). I initially changed the settings from "Default System Setting" to "No Indexing" on all the directories and afterwards I have started getting following error :
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#***.*** and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
I have then reverted all the settings back to their original but still getting the same error.
Following error is shown in Error Log -
[Tue Dec 04 01:20:54 2012] [alert] [client 119.226.234.18] /home/***/public_html/.htaccess: ErrorDocument takes two arguments, ErrorDocument Apache configuration directive
I don't understand how to resolve this!! Please help!!
It's an error in your htaccess.
Open .htaccess in a texteditor. The line with ErrorDocument should look like this:
ErrorDocument 404 /404.html
I was also facing same issue.
By changing the folder permission that I was trying to access to 755 in file manager resolved the issue.
Try to check this error log:
/usr/local/apache/logs/error_log

Allow access to stand-alone php file Wordpress

I am developing a wordpress theme and I want to use jQuery.load() to load data from a PHP file in my theme directory called process.php to a div in a wordpress page template.
I haven't had any issues with load() in the past but Wordpress is preventing me from loading the data or even accessing the process.php file in the browser.
When I navigate to the full path of the file (eg: http://[site]/[theme]/functions/process.php) I get the following error in Chrome
Internal Server Error.
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, **#gmial.com and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.
More information about this error may be available in the server error
log.
I've read similar questions but they involve modifying the .htaccess file. Does anyone know how to do this from a theme perspective ie: using $wp_rewrite.
EDIT
Linux Server error log states [Mon Mar 12 14:00:52 2012] [error] [client 121.98.81.237] SoftException in Application.cpp:245: File "/var/www/vhosts/****.co.nz/httpdocs/npr/wp-content/themes/_s_2/functions/process.php" is writeable by group
[Mon Mar 12 14:00:52 2012] [error] [client 121.98.81.237] Premature end of script headers: process.php
and this is process.php
<?php
echo "hello from php";
?>
I think the better way is use by init action and check the $_GET/$_POST, and return the string you want.. and if all ok, you can die() the script.
For this way you get access to wordpress db and all..

Categories