500 Internal Server Error when accessing domain/foldername - php

I am getting the 500 Internal Server Error on my website.
Full message:
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#subxchange.com 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.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.4.10 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 Server at subxchange.com Port 443
Image: http://i.gyazo.com/31e237bca4593dc71b0923ba9c044ae1.png
I am getting the message when trying to access my admin panel such as domain.com/admin-panel
I can however access the frontend just fine such as domain.com.
I have checked the permissions and folders are set to 755 while files are set to 644.
This is the error log:
[Sat Jun 20 14:57:59.954476 2015] [:error] [pid 7920] [client 213.114.166.90:35286] SoftException in Application.cpp:357: UID of script "/home/subxchange/public_html/admin-panel/index.php" is smaller than min_uid
[Sat Jun 20 14:56:09.703965 2015] [:error] [pid 7564] [client 213.114.166.90:35213] SoftException in Application.cpp:357: UID of script "/home/subxchange/public_html/admin-panel/index.php" is smaller than min_uid
[Sat Jun 20 14:56:09.398852 2015] [:error] [pid 7910] [client 213.114.166.90:35198] SoftException in Application.cpp:357: UID of script "/home/subxchange/public_html/admin-panel/index.php" is smaller than min_uid
....
Does someone have any idea how to solve this?

It's a permissions issue, you need to set correct user and group ownership in addition to rwx:
chown -R www-data:www-data /home/subxchange/public_html
And make sure correct properties for public_html are set:
chmod 755 -R /home/subxchange/public_html

Related

500 Internal Server Error for php file (not for html) after installing SSL

After installing SSL on the server, the .php files stopped working and gave an error 500:
https://freshfinance.pl/empty.php
HTML works fine:
https://freshfinance.pl/
I have 2 entries in error.log:
[Sun Nov 07 13:01:47.229672 2021] [fcgid:warn] [pid 4630]
(104)Connection reset by peer: [client 162.158.102.105:56384]
mod_fcgid: error reading data from FastCGI server [Sun Nov 07
13:01:47.229742 2021] [core:error] [pid 4630] [client
162.158.102.105:56384] End of script output before headers: empty.php
I have read other forum posts about a similar issue but none have been helpful (e.g. 500 Internal Server Error for php file not for html)
What could be causing the problem on my server?

php - Laravel in shared hosting give me "Internal Server Error"

in my hosting I have a few pages in folders inside of public_html.
So, I need upload a Laravel project in a new folder for access like this: "www.mypage.com/laravelproject". My problem is that I create a folder laravelproject and I put all the laravel project inside this, but give me:
Forbidden
You don't have permission to access /laravelproject/ on this server.
Additionally, a 404 Not Found error was encountered while trying to
use an ErrorDocument to handle the request.
And if i try enter to: "www.mypage.com/laravelproject/public" I receive this error:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
The hosting give me this errors that produce the project. The project name is "eysa", so I want access it like: "www.mydomain.com/eysa":
[Thu Sep 14 14:31:54 2017] [alert] [client 190.19.102.99]
/var/www/vhost/example.com/home/html/eysa/public/.htaccess: Option
MultiViews not allowed here [Thu Sep 14 14:31:54 2017] [error] [client
190.19.102.99] File does not exist: /var/www/vhost/example.com/home/errors/500.html [Thu Sep 14
14:31:54 2017] [error] [client 190.19.102.99] File does not exist:
/var/www/vhost/example.com/home/html/favicon.ico, referer:
http://example.com/eysa/public [Thu Sep 14 14:31:54 2017] [error]
[client 190.19.102.99] File does not exist:
/var/www/vhost/example.com/home/errors/404.html, referer:
http://example.com/eysa/public
I need help!
Thanks!
Ok, so let's tear down your log file
Here is your main problem your server configuration does not allow to use MultiViews, removing that from your .htaccess file probably should fix the issue.
[Thu Sep 14 14:31:54 2017] [alert] [client 190.19.102.99]
/var/www/vhost/example.com/home/html/eysa/public/.htaccess: Option
MultiViews not allowed here
Your server looking for your custom error page but cannot found, you can define yours in .htaccess as well ;
[Thu Sep 14 14:31:54 2017] [error] [client
190.19.102.99] File does not exist: /var/www/vhost/example.com/home/errors/500.html
Your browser tries to get favicon.ico but cannot be found in root.
[Thu Sep 14 14:31:54
2017] [error] [client 190.19.102.99] File does not exist:
/var/www/vhost/example.com/home/html/favicon.ico, referer:
http://example.com/eysa/public
This is also almost identical error with the one above, same comment applies.
[Thu Sep 14 14:31:54 2017] [error]
[client 190.19.102.99] File does not exist:
/var/www/vhost/example.com/home/errors/404.html, referer:
http://example.com/eysa/public
Seems like your server only allows MultiViews on your root folder, if laravel requires this you can create a sub-domain or create a virtual folder if your hosting allows.

php does not work always returns 500 error

I host 3 web site on an vps.
each has a phpt test script
a1.com/test.php
a2.com/test.php
a3.com/test.php
a1.com/test.php
a2.com/test.php
work well
but when I call
a3.com/test.php
it always report error
[Wed Jan 28 01:01:52.801563 2015]
[fcgid:warn] [pid 27783] (104)Connection reset by peer:
[client ***.***.27.***:50211]
mod_fcgid: error reading data from FastCGI server
[Wed Jan 28 01:01:52.801651 2015] [core:error] [pid 27783]
[client ***.***.27.***:50211]
End of script output before headers: test.php
your comment welcome
Speaking on personal experience, make sure that the directory/file permissions are set properly on a3.com/test.php. If not set properly they can result in a 500 error

Setting up PHP for Apache on Windows

I have been trying to set up PHP from php.net in my Apache web server (localhost).
Over the last day and a half I've been chasing through documentation at the Apache site, the php.net site, SO, and anywhere else shows a hit for the current error, to try and solve the problems. Here are some details of my current set-up and (possible mis)understanding.
Define SRVROOT "/Apache/00"
ServerRoot "${SRVROOT}"
The public directory of Apache is set to htdocs. Apache is producing listings of the directories under it without any problems through localhost. Just to make bleeding sure that I have the right address and it it is Apache, I do an on/off test as described below.
I ran the Windows MSI supplied for PHP. Then I adjusted the /conf/httpd.conf file to add:
ScriptAlias /php/ "${SRVROOT}/php/"
AddType application/x-httpd-php .php
Note: php, htdocs (public files) & conf directories are all in the root of the same directory, SRVROOT.
Test Apache
http://localhost/lib/
might produce:
Index of /lib
Parent Directory
amd64/
web.jar
x86/
While shutting down Apache and refreshing the listing I see a FF error.
Unable to connect
Firefox can't establish a connection to the server at localhost.
So Apache itself seems to be working fine, when it is running I can do directory listings.
Test PHP
http://localhost/php/
Shows:
Forbidden
You don't have permission to access /php/ on this server.
OK that seems logical, Apache now acknowledges the existence of the directory but says it is not intended to by publicly browsed.
I have an phpinfo.php in the root of the php directory containing.
<?phpinfo();?>
I expect that if I browse to http://localhost/phpinfo.php is should give me information, but instead I get 404 message:
Not Found
The requested URL /phpinfo.php was not found on this server.
For http://localhost/php/phpinfo.php I get forbidden message:
Forbidden
You don't have permission to access /php/phpinfo.php on this server.
Typical error.log
sl:warn] [pid 1504:tid 336] AH01909: RSA certificate configured for localhost:443 does NOT include an ID which matches the server name
[Sun Aug 04 19:06:01.995343 2013] [ssl:warn] [pid 1504:tid 336] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Aug 04 19:06:02.298078 2013] [ssl:warn] [pid 1504:tid 336] AH01909: RSA certificate configured for localhost:443 does NOT include an ID which matches the server name
[Sun Aug 04 19:06:02.298078 2013] [ssl:warn] [pid 1504:tid 336] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Aug 04 19:06:02.300031 2013] [mpm_winnt:notice] [pid 1504:tid 336] AH00354: Child: Starting 64 worker threads.
[Sun Aug 04 19:06:03.279523 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50589] AH01630: client denied by server configuration: I:/Apache/00/php/index.html
[Sun Aug 04 19:15:39.932843 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50599] AH01630: client denied by server configuration: I:/Apache/00/php/
[Sun Aug 04 19:21:49.700421 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50608] AH01630: client denied by server configuration: I:/Apache/00/php/phpinfo.php
[Sun Aug 04 19:26:58.432843 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50621] AH01630: client denied by server configuration: I:/Apache/00/php/phpinfo.php
[Sun Aug 04 19:37:26.403546 2013] [mpm_winnt:notice] [pid 4400:tid 324] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 04 19:37:28.403546 2013] [mpm_winnt:notice] [pid 1504:tid 336] AH00364: Child: All worker threads have exited.
[Sun Aug 04 19:37:28.418195 2013] [mpm_winnt:notice] [pid 4400:tid 324] AH00430: Parent: Child process 1504 exited successfully.
Question
I want to show the phpinfo.php document. Can anyone see the dumb mistake I am making (I am a newbie at this)?
See also:
These are the primary docs I've been looking at:
http://httpd.apache.org/docs/2.4/
http://www.php.net/docs.php
You're probably getting the permission error because the phpinfo.php file does not have permissions set such that the Apache server you're running can read it. Apache can be configured to drop privileges to a limited user account when it runs, and if your file security permissions for a file don't allow that user account to read the file, you will get permission errors. Remember that this applies to every directory in the final path name, i.e. /Apache and /Apache/00 and /Apache/00/php and /Apache/00/php/phpinfo.php must ALL be readable by the user account that Apache runs under.
Another possibility is that you may need to add a Directory directive in httpd.conf to allow access to /php/ if your httpd.conf has a Directory directive for a default access policy of deny-first.
I also don't see any mention of where you've installed the PHP Apache module DLL into the Apache modules folder, nor where you've added the module in your httpd.conf file. If you don't load the PHP module, PHP files will not pass through PHP.

CakePHP on a Mac - Internal Server Error

I have been creating a CakePHP application on my Linux computer and running it using Lampp. Everything has been going well.
I have passed the project to a designer to do some layout updates who is using a Mac and running Mamp.
When he try to run the project he is receiving the following error:
The website encountered an error while retrieving
http://localhost:8888/. It may be down for maintenance or configured
incorrectly. Here are some suggestions: Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was
encountered while the server was attempting to fulfill the request.
Why would this error occur on his Mac but not my Linux?
EDIT:
The Server log is showing the following:
[Sun Sep 04 20:07:50 2011] [error] [client ::1] client denied by
server configuration: /Users/Jamie/Sites/.DS_Store [Sun Sep 04
20:07:52 2011] [error] [client ::1] client denied by server
configuration: /Users/Jamie/Sites/Glecto/.DS_Store, referer:
http://localhost:8888/ [Sun Sep 04 20:15:52 2011] [notice] caught
SIGTERM, shutting down [Sun Sep 04 20:15:55 2011] [notice] Digest:
generating secret for digest authentication ...
I had the same problem recently using MAMP. I copied a plain php site from online to local for testing and the site kept giving me that error when I browsed to it locally. It turned out to be the permissions on the files. I had to go through the files and folders and change the permissions. Hope this helps

Categories