Monday, October 17, 2016

PHP - Error 500 - Centos 7

I have a Google Instance running Centos 7.

I had this strange Error 500 message whenever I upload a piece of php code.

When accessing through the browser, it comes up with the error message, which was loading without issues in my local machine.

I searched around and found a solution probable solution.

Somebody suggested that I execute the following command to make it right.

sudo chcon unconfined_u:object_r:httpd_config_t:s0 myfile.php

It did work though I do not know why. My guess is that it could be something to do with the newline and return values.

Notepad plus, which is the editor that I used for this purpose, has the options, Windows, Unix and Old Mac under "Edit", "EOL Conversion". My guess is that choosing "Unix/OSX format" when saving you code in Notepad plus might be another method to solve the problem.

No comments: