3

I installed apache2, php5 and mysql. http://localhost/ url in browser shows it works. I saved a php file in /var/www/ as testphp.php. Code in the file is..

<?php
phpinfo();
?>

Now on entering http://localhost/testphp.php in browser, it gives this error..

enter image description here

I don't understand why this is happening. Can anyone explain how to work with php? Also please explain how to connect php with mysql server installed on my system.

EDIT : I open the file from terminal in gedit. When I edit some text in the file, these warnings appear in the terminal..

(gedit:28157): Gtk-WARNING **: Calling Inhibit failed: 
GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

EDIT2 : I saved the file to /var/www/html but still get the error.

vinayawsm
  • 437
  • 2
  • 8
  • 22

1 Answers1

1

The path where php file should be stored should be correct. Store your php file of /var/www/html/yourdirectory/filename.php follow above path and then in the browser type:

http://localhost/yourdirectory/filename.php
George Udosen
  • 36,677