first I wish you a happy new year!
I got the following problem:
I receive an Internal Error 500 when trying to open one of my websites on my server which uses .php files. All Domains configured on this user don't work. The Domains configured on other users are working fine.
Checking out the error log gave me the error "Premature end of script". Until yesterday everything worked fine and I haven't made changes since than.
I checked out the following possibilities:
APC in php.ini -> doesn't exists in my php ini (https://www.drupal.org/node/213260)
File Permissions (500 Server error: Premature end of script headers:)
RLimitCPU and RLimitMEM
some other things with general configuration, but they can't be the reason because my other sites with php are working fine
I compared the Apache config of the different domains but couldn't find a relevant difference. Unluckily I changed the rights of the files in this directory and now my ftp isn't working anymore (set them to 705). Any Ideas on both problems?
Server is CentOS 6.7 with PHP 5.3.3 and Webmin Interface
FTP Server is ProFTPD
Thanks in advance!
I solved the problem with the premature end of script. The quota of the user was more than full, which was done by a failure in a cronjob. facepalm
Related
I'm having an issue where I get an "Internal Server Error" on my php page. To try and debug it, I attempted to use the error_log function in php. However I could not get it to write anything to the error log. Even in a simple php file:
httpdocs/temp.php
<?php
error_log("this is an error");
echo "hello";
?>
I would receive a basic internal server error message:
Internal Server Error The server encountered an internal error or
misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the
error occurred and of anything you might have done that may have
caused the error.
More information about this error may be available in the server error
log.
Web Server at xxxxxxxx.com
So I looked up how to set up the error_log properly, thinking that it was somehow not set up correctly. I found this article.
Since I am on windows I edited the .user.ini file in my httpdocs root folder and added the error_log line:
httpdocs/.user.ini
[PHP]
error_log=G:\PleskVhosts\xxxxxxxxxx.com\httpdocs\php_error.log
display_errors=off
log_errors=on
open_basedir="G:/PleskVhosts//xxxxxxxxx.com\;C:\Windows\Temp\"
safe_mode=off
sendmail_from=xxxxxxxxx#xxxxxxxxx.shr.prod.phx3.secureserver.net
SMTP=relay-hosting.secureserver.net
This article helped me get the absolute path
I restarted the IIS application pool and created an empty php_error.log file in my httpdocs folder, however it still never wrote anything to the log file, and continued to just give the Internal Server Error. I also tried removing all the other lines in the .user.ini file besides the error_log line, restarted, and still nothing. I also tried stopping the application pool and starting it up again, still nothing.
I double checked the phpinfo and the log_errors field was set to on, and the correct directory was set for error_log. So it is seeing the .user.ini file.
I tried calling their support but they couldn't help me.
They linked me to this article about IIS error handling. I created a web.config file and put it in the httpdocs folder as it says in that article. Now I get something different. Now the output of my page is the error that I was passing to error_log. So in other words, when I visit test.php the output on the screen says:
this is an error
Notice how the php script dies after the error? Not only should the error not be put on screen (it should be put in the php_error.log file, which is still not being written to at this point), but the php script shouldn't die afterwards unless it runs into a fatal error. I should see the "hello" from the echo and I don't.
What do I have to do to get this working properly?
My hosting plan has IIS 8 and PHP 5.4 installed.
PS. Their support basically said they cant help me any further because changing configuration files is "coding" and they dont offer coding support.
PHP needed file read write permisions
I am using wamp and am creating a uLogin PHP Authentication Library(http://ulogin.sourceforge.net/). I have access to phpmyadmin, the local host seems to work, phpinfo() runs, everything on there seems to be working.
The problem is the c:/wamp/www/ulogin is giving me a forbidden 403 in the console. The error log for apache(2.4.9) is giving me AH01797: client denied by server configuration: My windows event log is giving me: an attempt was made to query the existence of a blank password for an account.
Is this a prblem with the wamp set up in apache or in the mysql setup; or both? I have run other php programs via www; this is the first time I ran into this problem.
I have researched this extensively and found a lot of the same answer, but it was for older versions of the program. Also, while developing on the localhost I can allow to all, I would prefer just to set it up as if the website was live.
Steps to check what's wrong:
1) Check your apache config: Check Directory-entries for your target directory and above. Look out for Order and Allow from (or Require for 2.4+)
2) Check whether there are any .htaccess files in your target directory or above. Again, look out for Allow / Deny and Require.
3) Check if the 403 is emitted by apache or your application: Add some debug message at the very top of your application logic (commonly some sort of index.php).
Good morning. I'm having a major issue with my phpBB installation.
I've transfered it to my computer to develop some plugins, so i'm running it on localhost, but, i've created a vHost with the exact same domain he is running online, so, i don't need to change the cookies configuration, and the database connection information is correct already.
Regard all of that, i'm getting a 500 internal server error, which displays no error on the screen nor the logs from apache and php.
I have error reporting on php as E_ALL also. What could be possible causing this, and what the solution might be?
Thanks in advance, Jorge Ferrari.
If you're getting nothing in the Apache / PHP error logs, then it's more likely to be a server configuration issue. I would suspect the problem is in a file called .htaccess in the phpBB folder. It can be used to customize the configuration in various ways, including things like setting up redirects and URL rewriting.
If the htaccess file tries to use an Apache feature which isn't available on the server, then it can generate a 500 error. You can test this by temporarily removing the file, and seeing if the website works at all (albeit possibly with some glitches).
If you've confirmed that it's the source of the problem, then ideally you'll need to enable the missing feature in the server's configuration (or possibly update the Apache installation). Alternatively, you can delete or comment-out the problematic bits of the htaccess file.
Either way, it sounds more like a webserver admin issue than programming. You might have more luck asking on the phpBB forums, or on a different Stack Exchange Q&A site (possibly Server Fault?).
Check whether you have Rewrite module enabled?(most of the this will be the reason)
In httpd.conf and uncomment
LoadModule rewrite_module modules/mod_rewrite.so
If you try to use module which is not loaded you will get 500 internal server error.
Check your modules used in .htaccess file and check httpd.conf whether used modules are loaded
When I try to access the website I get this error:
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request
even after removing the htaccess file completely the website is still not working. NOTE: on localhost it's working fine.
Edit after comments:
I think I wasn't clear enough here's my problem in details:
I have a website written with PHP5 no framework or cms or anything and it work fine.
Then I start the admin section so I used CodeIgniter and rewrite the site.
Now I almost done with the programming so I uploaded a test version to the server in a subfolder to test it but the 500 error mentioned above appeared, my first thoughts were that it's a htaccess file problem so I try other htaccess files and finally removed it from the server, but the problem still there.
Now the only difference between my local server and the remote server is that locally i'm running PHP 5.3.5 and remotely it's PHP 5.2.14.
That's all the information that I can think of now.
Thanx in advance.
You likey have a missing PHP/Apache module hence the 500 error.
1: Check your logs within the root and the dir your running script in, else the directory above root/logs.
2: Create a file called phpinfo.php, in it put:
<?php phpinfo(); ?>
and run it.
3: Then compare the list of installed extensions shown in the output with the list of installed modules you have locally.
If your using WAMP, you click the tray icon, goto PHP->extentions and you can see all that are installed. Same for Apache.
boff
additionally:
A good start would to to make sure CURL and MBSTRING is on, however I don't use CAKE PHP....
I got same problem and added this line on top
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
I have a Windows 7 laptop. I downloaded PHP 5.2.8. I downloaded Apache 2.2.
I ran the MSI for PHP install, which i know is not recommended but I tried multiple times the normal route without success.
I have apache running and it shows "Running all apache services". When i did the install i set it up for "localhost".
I checked the CGI checkbox in my control panel.
I placed a simple file, test.php , in C:\inetpub\wwwroot ... but when the file is double-clicked, it tries to download the file instead of opening it as a webpage.
I've been googling this for a couple of hours and cant find a suitable fix. I have cleared my cache, and still no luck.
I also set apache to listen on port 8080 just to be certain nothing else was using port 80 before hand.
Any Ideas??
Thanks!
update -- i was missing the php5apache2.dll ... i placed this in the PHP directory but still the same results. i have also tried browsing to the file location through IE which didnt change anything either unfortunately.
update again, - - DOH! - - didnt realize it was localhost/test.php or what the answer below was. when i do that, i get a server error page.. which is better than before i guess :)
Server Error in Application "DEFAULT WEB SITE"
HTTP Error 500.0 - Internal Server Error
An unknown FastCGI error occured
Module FastCgiModule
Notification ExecuteRequestHandler
Handler PHP
Error Code 0x8007010b
Requested URL http://localhost:80/test.php
Physical Path C:\inetpub\wwwroot\test.php
Logon Method Anonymous
Logon User Anonymous
Most likely causes:
•IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
•IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
•IIS was not able to process configuration for the Web site or application.
•The authenticated user does not have permission to use this DLL.
•The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
when i try to start/run apache, it errors out. so when i run apache test configuration i get the following message:
httpd.exe: Syntax error on line 1 of C:/Apache/conf/httpd.conf: Cannot load C:/php/php5apache2_2.dll into server: The specified module could not be found.
However when i browse to that director, i do see that dll file there!! ugh...
ideas?
If you placed a file called test.php in C:\inetpub\wwwroot, then you would open your browser to http://localhost/test.php to try to execute the file.
The php5apache2.dll file needs to go in your module directory for apache, and you would need to add the appropriate apache config lines such as those below:
LoadModule php5_module "c:/path/to/php5apache2.dll"
AddHandler application/x-httpd-php .php
SetHandler application/x-httpd-php
After making those changes, you will need to restart apache.
Assuming you have PHP installed in Apache properly as mentioned in the other answers, it is possible the .php page is not sending the correct header. I have a .php file that emits a header with Content-Type: text/json, this is commonly used to provide a service for an Ajax client. The .php page should be sending Context-Type: text/html.
To determine if this is indeed the problem you can use wget with the -S option, or use developer tools in your browser. Take a look at this answer: Tool to view response headers
Double clicked? As in within explorer? If so, this won't open the page. You need to browse to the page. If you're within the directory listing for apache double clicking is not necessary.
As for setting up, if you're new your best bet is to use iis, easyphp, xampp, or some other variation
EasyPHP: http://www.easyphp.org/
Xampp: http://www.apachefriends.org/en/xampp.html
They'll get you running without the hassle