Skip to content

Using phpinfo() and your PHP server settings to debug a PHP error.

Notifications You must be signed in to change notification settings

codeadamca/php-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using the phpinfo Function

When you're coding PHP, debugging can be difficult. By default when a PHP error occues your browser will likely display a This pags isn't working message. This message is not too helpful.

PHP Default Error

There are a handful of methods to have PHP display a much more descriptive error.

PHP Helpful Error

MAMP/WAMP

If you are using a local server you will need to chagne your php.ini file. First you need to locate this file. Place the provided phpinfo.php file in your server root and test. It will list all of your PHP settings.

PHP Info

Locate the Loaded Configuration File setting note where the php.ini files is located. Mine is located in the /Applications/MAMP/bin/php/php7.3.9/conf/php.ini folder. Open this file, find the line that says display_errors = Off and change it to display_errors = On.

Save and restart your server.

PHP Hosting

If you are using hosting to test your PHP files you can change the same setting using your hosting control panel. Log in to your hosting control panel and look for a group of PHP related options. With Infinity Free hosting it's called Alter PHP config.

Control Panel

Once you are in the PHP settings look for an option related to displaying PHP errors, turn it on, and refresh your page.


Repo Resources

About

Using phpinfo() and your PHP server settings to debug a PHP error.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages