MarcS
By:
MarcS

How do i resolve Server Error 500

August 13, 2016 6.5k views
Apache Ubuntu 16.04

I have been installing everything. apache2, php, mysql and everything that i need.

Everything works fine before i upload my files. After i have uploaded my files and tried to connect to the ip adress it shows this error:

The 198.199.80.212 page isn’t working

198.199.80.212 is currently unable to handle this request.
HTTP ERROR 500

How do i fix this? This is my error log:

[Sat Aug 13 11:41:51.903537 2016] [mpmprefork:notice] [pid 11548] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat Aug 13 11:41:51.903622 2016] [core:notice] [pid 11548] AH00094: Command line: '/usr/sbin/apache2'
[Sat Aug 13 11:50:38.149098 2016] [:error] [pid 11555] [client 87.48.21.80:5121] PHP Fatal error: Uncaught Error: Call to undefined function mysql
connect() in /var/www/html/set.php:3\nStack trace:\n#0 /var/www/html/index.php(9): includeonce()\n#1 {main}\n thrown in /var/www/html/set.php on line 3
[Sat Aug 13 11:50:40.289534 2016] [:error] [pid 11551] [client 87.48.21.80:5120] PHP Fatal error: Uncaught Error: Call to undefined function mysql
connect() in /var/www/html/set.php:3\nStack trace:\n#0 /var/www/html/index.php(9): includeonce()\n#1 {main}\n thrown in /var/www/html/set.php on line 3
[Sat Aug 13 12:08:45.348023 2016] [:error] [pid 11551] [client 87.48.21.80:5198] PHP Fatal error: Uncaught Error: Call to undefined function mysql
connect() in /var/www/html/set.php:3\nStack trace:\n#0 /var/www/html/index.php(10): includeonce()\n#1 {main}\n thrown in /var/www/html/set.php on line 3
[Sat Aug 13 12:20:46.474781 2016] [mpm_prefork:notice] [pid 11548] AH00169: caught SIGTERM, shutting down
[Sat Aug 13 12:20:47.630198 2016] [mpm_prefork:notice] [pid 11974] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat Aug 13 12:20:47.630283 2016] [core:notice] [pid 11974] AH00094: Command line: '/usr/sbin/apache2'
[Sat Aug 13 12:50:49.899200 2016] [:error] [pid 11981] [client 87.48.21.80:5676] PHP Fatal error: Uncaught Error: Call to undefined function mysql
connect() in /var/www/html/set.php:3\nStack trace:\n#0 /var/www/html/index.php(9): includeonce()\n#1 {main}\n thrown in /var/www/html/set.php on line 3
[Sat Aug 13 12:54:13.688271 2016] [:error] [pid 11977] [client 87.48.21.80:5694] PHP Fatal error: Uncaught Error: Call to undefined function mysql
connect() in /var/www/html/set.php:3\nStack trace:\n#0 /var/www/html/index.php(9): include_once()\n#1 {main}\n thrown in /var/www/html/set.php on line 3

2 Answers

The problem is : "Call to undefined function mysqlconnect()"

If this function is not defined by you, then it mysql_connect() and it's deprecated since php 5.5 and removed since php 7.0

http://php.net/manual/en/function.mysql-connect.php

The log even tells you where the problem is:

Stack trace

0 /var/www/html/index.php(9): include_once() 1 {main}
thrown in /var/www/html/set.php on line 3

I had the same problem, the only way i got pass this was correcting folder permissions of app/storage and app/bootstrap/cache like this:
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache

Have another answer? Share your knowledge.