

This directive allows you to set the error reporting level. It’s important that you don’t ever enable this on a production site-it will slow your site down and could give hackers valuable clues to your site's security vulnerabilities. You can set it to On if you want errors to be displayed on the screen and Off if you want to disable it. The display_errors directive allows you to control whether errors are displayed on the screen during script execution. In this section, we’ll go through directives that are related to error handling and are useful for debugging during development. Let’s have a look at the types of directives that we’re going to discuss. Of course, we won’t go through each and every directive, but I’ll try to cover the most important ones. I'll try to group them based on their behavior, and I hope it’ll be easy for you to understand. In fact, when you open the php.ini file, you may get overwhelmed by the number of directives it provides. The php.ini file provides a lot of configuration directives that allow you to modify various behaviors of PHP. In the next section, we’ll explore a couple of important settings in the php.ini file.
Xampp for mac php.ini software#
On the other hand, if you’re using software like WAMP or XAMPP to run your web development stack, it’s even easier to modify the php.ini file-you can directly access it via the WAMP or XAMPP UI. Of course, if you’re running PHP as an Apache module, you need to restart the Apache server to make sure that the changes you’ve made in the php.ini file are reflected. So you can edit the php.ini file indicated in the Loaded Configuration File section, and that should work in most cases. And the second one, Loaded Configuration File, is the path from where the php.ini file is being loaded when PHP is run. The first one, Configuration File (php.ini) Path, indicates the default path of the php.ini file in your system. Look for the following section.Īs you can see, there are two sections. Load this file in your browser, and you should see the output of phpinfo(). Go ahead and create the phpinfo.php file with the following contents and place it in your document root: It will tell you where php.ini is located, and it will also output all the important PHP configuration information. This is where the phpinfo() function comes to the rescue. On the other hand, if you’re running another operating system, then it’s difficult to guess the exact location of the php.ini file-there are several possibilities. If you’re running Windows, you'll likely find the php.ini file within the directory of your PHP installation in the system drive.

This can be tricky-the location of the php.ini file vastly varies by the environment you’re running PHP with.
Xampp for mac php.ini how to#
In this section, we’ll see how to find the php.ini file which is loaded when you run the PHP script. In fact, as a PHP developer, it’s inevitable, and you’ll encounter it sooner rather than later. However, the php.ini file provides a couple of important settings that you want to make yourself familiar with. In fact, there are no critical configuration parameters that you must set in order to run PHP. PHP can run happily with the settings provided in the default php.ini file, since PHP ships with these default recommended settings. On the other hand, it’s certainly possible that you've never needed to modify php.ini. Quite often, you’ll find you need to tweak settings in the php.ini file. This file allows you to configure a few important settings that you should be aware of. When PHP is run, it looks for the php.ini file in some specific locations and loads it. Whether you’re a PHP beginner or a seasoned developer, I’m sure that you’ve heard of php.ini: the most important PHP configuration file. From the beginner’s perspective, we’ll discuss what it’s meant for, where to locate it, and a couple of important configuration settings it provides. In this tutorial, we’re going to discuss php.ini-the main configuration file in PHP.
