I have installed LAMP on Ubuntu 12.04. I am able to work with MySQL through Command prompt and User Interface, but when I try to execute a PHP script which includes HTML and MySQL statements, the browser is not displaying the script output and no errors are shown.
-
Do you have error-reporting turned on? In your php config file change the error_reporting to E_all and restart Apache.– DanAug 9, 2013 at 13:49
-
Can you post your php script on paste.ubuntu.com?– Radu RădeanuAug 9, 2013 at 14:11
-
3Possible duplicate of PHP errors are not showing in browser only page goes blank– muruFeb 27, 2017 at 13:24
1 Answer
Apart from the solution dan08 provided, may I know if you have write/execute privilege to the default /var/www directory? Try saving a sample file to that directory.
Run your script as http://localhost/[directory name]/[file name].php
Ok, you can do it now. Fine, if your browser shows well on http://localhost
, then run http://localhost/phpmyadmin
(i assume that you have phpmyadmin installed and configured properly for mysql- if not, consider installing it). Can you login and see the localhost interface of mysql?
If you can see nothing, restart apache.