Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to locate the php.ini file (xampp)

Tags:

php

xampp

ini

I am using xamppserver for PHP development and want to edit the php.ini file; where can I locate it?

like image 473
Navane Avatar asked May 31 '11 09:05

Navane


People also ask

Where can I find PHP ini file in xampp?

ini file: Whenever we install PHP, we can locate the configuration file inside the PHP folder. If using xampp, we can find the configuration file in one or many versions, inside the path '\xampp\php'.

Where is PHP ini xampp Mac?

In XAMPP (Windows), the php. ini file is in the C:\xampp\php folder. In XAMPP (Mac OSX), the php. ini file is in the /Applications/XAMPP/xamppfiles/etc folder.

How do I open a PHP ini file in Windows?

In Windows Explorer, open your PHP installation folder, for example C:\PHP . In a text editor, open the php. ini file.


2 Answers

For Windows, you can find the file in the C:\xampp\php\php.ini-Folder (Windows) or in the etc-Folder (within the xampp-Folder).

Under Linux, most distributions put lampp under /opt/lampp, so the file can be found under /opt/lampp/etc/php.ini.

It can be edited using a normal Text-Editor.

Clarification:

  • Xampp (X (for "some OS"), Apache, MySQL, Perl, PHP)
  • Lampp (Linux, Apache, MySQL, Perl, PHP)

in this context, they can be substituted for one another.

like image 125
Lukas Knuth Avatar answered Sep 23 '22 12:09

Lukas Knuth


Write the following inside phpini_path.php( or AnyNameAsYouLike.php) and run it in the browser.

<?php phpinfo();?> 

Among various other parameters you'll get Loaded Configuration File parameter which value is the path of php.ini on the server.

The location of php.ini depends on server operating system:

Windows (With Xampp Installation):

/xampp/php/php.ini  

macOS, OS X:

/private/etc/php.ini 

Linux:

/etc/php.ini /usr/bin/php5/bin/php.ini /etc/php/php.ini /etc/php5/apache2/php.ini 
like image 22
Ipsita Rout Avatar answered Sep 23 '22 12:09

Ipsita Rout