My site frequently displays 500 Internal Server Error. Restarting apache, brings the site back to normal state. Other sites running on the same server does not have this issue. Apache error log have no information related to this. The apache loglevel of this site is set as "warn".
What may be the reason for this ?
My site is written on PHP and deployed in linux server.
If you have suphp installed it might be e permissions problem - if its installed all the files need to have chmod set to 644 and all thefolders - 755
Please check the folder necessary permissions. Then in index.php file add
ini_set('display_errors', 1);
to display error reports. So that you can find the error.
Related
I got a project for some enhancement which is running on CakePHP 2.9.
which is a ERP for govt Hospitals, i need work on admin panel for some enhancements.
I copied the project folder in localhost
/var/www/html/
and already imported schema into my phpmyadmin named esic.
and then i configured my esic/app/config/database.php file to the database(esic).
When I'm accessing the project from localhost, it is showing an error.
localhost/esic/
Internal Server Error The server encountered an internal error or
misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster#localhost to
inform them of the time this error occurred, and the actions you
performed just before this error.
More information about this error may be available in the server error
log.
I read the issue on Google and CakePHP official site but I didn't understand anything.
Please help me to figure out this problem.
Please let me know if some other details required.
Note: All other projects are working fine.
500 internal server occurs when the desired file or URL is not accessible.
AS you said all other projects are running on your localhost then please check that your .htaccess file is correct on this project.
Or else check other URL of the project.
Link: https://book.cakephp.org/2.0/en/installation/url-rewriting.html
If you are using linux environment try maybe only the permission of the folder. I somehow encounter that problem.
sudo chmod -R 755 /var/www/html/esic
or
sudo chmod -R 777 /var/www/html/esic
I am having a online website and I want to edit my site locally with the use of XAMPP. Here are the things I have done below:
- Change Xampp port Listen 80 to 8080
- Install database to MySQL
- put my website files into htdocs
- change username, dbname in local.xml
- change web/secure/base_url and web/unsecured/base_url to http://127.0.0.1:8080/(my folder name) in MySQL database, core_config_data table
However, my website does not show after I have done all these.
It occurs Error 500.
what should I do for this to display my website?
After I change the permission and files to 777, I check for the error log in the xampp files (xampp\apache\logs. The error log shows below:
Solution 1:
If you're facing a 500 error then firstly you should search for the webserver error log, and if it's running on apache server it can mostly be found in one of these 2 locations:
Centos or Archlinux: /var/log/httpd/
Debian or Ubuntu: /var/log/apache2/
In xampp, you can find the error logs in \xampp\apache\logs\error.log, where xampp is your installation folder, if you didn't change the error_log setting in PHP.
Solution 2:
You can simply enable all errors by setting ini_set('display_errors', 1); from the index.php file of your Magento project, something like this:
index.php:
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
.htaccess:
SetEnv MAGE_IS_DEVELOPER_MODE "true"
You can also check errors in /var/log/system.log and /var/log/exception.log. in your Magento project's directory.
By default Magento errors output is off. If your PHP is not
configured to log errors then web server will return Internal 500 error in
case of fatal error.
OR maybe you're facing this issue because of the permission to your project folders, so the first thing you should look for error in the logs and then you can easily fix it.
But, if the issue occurs due to the permission then:
# Change folders permission to 777
app/etc
var
media
# Change files permission to 644
index.php (main index file in magento root folder)
downloader/index.php
My dedicated server has Debian wheezy installed along with Apache2 php and mysql. ISPConfig3 is installed as the control panel.
After creating a site under ISPConfig and a shell user account with it I uploaded the tar file into the web directory and extracted the files.
The default ispconfig index.html file would display how ever after the extraction the index.php is not getting picked up and after deleting the default index.php i get the error message
Forbidden
You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
I tried going directly to www.domain.com/index.php and that doesnt work too.
Do I have to modify anything in apache? Any help would be appreciated.
That error is telling you the server can't read the file (or files) specified in your DirectoryIndex directive, and is trying to display a 403 (security) error document instead, which is doesn't have permission to read either.
You need to check what user your httpd daemon is running as, and make sure that user had at least read permissions to all the files in your DocumentRoot. The best way to do this is to ensure that user is the owner of the files.
On a Redhat/CentOS system, httpd runs as the user "apache"
chown -R apache:apache /var/www/html
I have configured Amazon EC2 Server and install PHP and MySQL. I have uploaded my website on it. it is in smarty.
Problem is when I update any .tpl file, then the server return white page as output in Firefox and Chrome return 500 Internal Server Error. I have surfed everywhere on internet but got nothing.
When I update any .php file then the code work nicely. problem is only with .tpl file.
I'm willing to bet that your templates_c directory is not writable by Apache (identified as apache or httpd, and you can check in your httpd.conf file), or it hasn't been configured correctly during Smarty initialization.
You can try temporarily setting your templates_c directory to 777 permissions to test this hypothesis.
If this ends up being the case, then you'll want to assign group ownership of templates_c to apache, and set the folder permissions to 775. (They explain this in their documentation.)
An HTTP status of 500, with no page content (Chrome is just being nice and rendering a default error message for you) means that PHP encountered a Fatal Error.
You will need to find out where PHP is configured to log to (usually a file called php_errors.log) and see what the error was.
Alternatively, you could temporarily allow PHP to output errors to screen, using the error_reporting setting.
Fresh install of a Debian server. Apache2, PHP5.
When I try to browse a PHP file I get 403 Forbidden. I am able to browse to html files.
I have tried the following:
Reinstalled Apache, PHP, libapache2-mod-php5
Restarted Apache
Checked the conf file thoroughly, copied from default, set the correct Directory path and allow from all
Checked permissions of directory, as a test have given full 777 permission to /var/www/site - still forbidden
Cant think of what else to try ?
Perform chmod 755 of the directory in which the PHP scripts reside.
After that restart the Apache/nginx server
or
if above method not work then contact your hosting provider to whitelist that url to phpscript because it can be issue with mod_security. Its the most annoying thing hostgator user are facing.
Check if the alow/deny pattern in your http.conf is set correctly.
What's written to the apache error log?