I have a PHP script that will not run through Apache. It is breaking at a mysql_connect command -
$connection = mysql_connect('localhost','root','password');
I can view output before this command, but the script stops running at this line. It would otherwise go on to produce a HTML table containing database table information.
When running the script using php script.php from the command line it executes correctly. However when I run curl localhost/script.php or just connect to it from a browser, it does not. What is causing / How can I resolve this issue?
Turning on logging revealed the error:
Fatal error: Call to undefined function mysql_connect() in /var/www/html/php/sqltable.php on line 11
line 11 being:
$connection = mysql_connect('localhost','root','password');