Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAMP Localhost not working (Error 500) - LWT

I am trying to run LWT on my mac and have installed MAMP for this. I have followed these instructions, but when I try to go to http://localhost:8888/lwt/ I am getting:

The localhost page isn’t working

localhost is currently unable to handle this request.

500

I have created a different folder in my htdocs folder and created a php file in it (index.php), with some code to see if php is working:

<?php
echo "this is the start";
phpinfo();
echo "<br>this is the end";
?>

That is all fine and works. I have also checked the user-rights for the lwt folder, but it seems fine too (Admins & Me are Read&Write, Others are ReadOnly). Typing tail -f /Applications/MAMP/logs/php_error.log into the terminal gives me the following error log:

PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /Applications/MAMP/htdocs/lwt/utilities.inc.php:3272
Stack trace:
#0 /Applications/MAMP/htdocs/lwt/index.php(46): require_once()
#1 {main}
  thrown in /Applications/MAMP/htdocs/lwt/utilities.inc.php on line 3272

I am a beginner though, so I don't know what else the problem could be. Any ideas?

like image 384
chrisnolten Avatar asked Sep 25 '22 14:09

chrisnolten


1 Answers

I don't know which version of PHP you use. But the mysql_* function are deprecated and its possible that its not included in your new version anymore. Use mysqli_* to connect to your database or use PDO.

In the new version of MAMP is PHP7 included. Perhaps you use that.

like image 64
René Höhle Avatar answered Sep 28 '22 06:09

René Höhle