https://github.com/codeadamca/php-info
Using phpinfo() and your PHP server settings to debug a PHP error.
https://github.com/codeadamca/php-info
learning-code php phpinfo
Last synced: 9 months ago
JSON representation
Using phpinfo() and your PHP server settings to debug a PHP error.
- Host: GitHub
- URL: https://github.com/codeadamca/php-info
- Owner: codeadamca
- Created: 2020-09-14T16:46:23.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-26T22:15:38.000Z (11 months ago)
- Last Synced: 2025-01-26T23:19:43.224Z (11 months ago)
- Topics: learning-code, php, phpinfo
- Language: PHP
- Homepage:
- Size: 816 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.

There are a handful of methods to have PHP display a much more descriptive 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.

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`.

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
- [Visual Studio Code](https://code.visualstudio.com/)
- [Filezilla](https://filezilla-project.org/)