MEM MEM - 23 days ago 24
PHP Question

phpinfo - an easy way for seeing it?

Each time I want to see the

phpinfo();
I have to:

create a info.php file;
write
phpinfo();
in it.
go to the browser and type my "thisproject.dev/info.php"

I'm on Ubuntu and my question is..
Isn't there a more practical way to see phpinfo on the browser ?

Thanks

Answer

From your command line you can run..

php -i

I know it's not the browser window, but you can't see the phpinfo(); contents without making the function call. Obviously, the best approach would be to have a phpinfo script in the root of your apache directory, that way you have access to it at all times via http://localhost/info.php or something similar.

EDIT: As mentioned by binaryLV, its quite common to have two versions of a php.ini per installation. One for the command line interface (CLI) and the other for the apache interface. Make sure you either symlink the CLI version to the apache one, or are only using one ini.

Comments