MAMP Localhost not working (error 500) - LWT

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

Local page not working

localhost is currently unable to process this request.

500

I created another folder in my htdocs folder and created a php file (index.php) with some code in it to find out if php works:

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

Everything is good and working. I also checked the user rights for the lwt folder, but it also seems very good (Admins and Me - Read & Write, Others - ReadOnly). Putting 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 new, so I don’t know what else could be the problem. Any ideas?

+5
source share
1 answer

I do not know what version of PHP you are using. But the mysql_* function is deprecated, and it is possible that it is no longer included in your new version. Use mysqli_* to connect to your database or use PDO.

The new version of MAMP includes PHP7. Perhaps you are using this.

+4
source

Source: https://habr.com/ru/post/1241156/


All Articles