How can I find my php.ini file?

Linode Staff

I need to edit my php.ini configuration, but I'm not sure where it is. How can I find it?

2 Replies

If you create a 'phpinfo' page on your website, it will show the location of the php.ini that is loaded by your web server.

To do this, make a new file with the following content:

<?php
phpinfo();
?>

Then, save it to the document root of your web site and give it the name phpinfo.php. Load this page in your browser, and it will list the location of your php.ini file.

Afterwards, you should consider removing that page so that your PHP's parameters are not exposed.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct