Where is php.ini (ubernub)

Hi, sorry if this is a stupid question, but where in the world is php.ini!!?!? I tried whereis php.ini, but that just gives me nonexistent places.

8 Replies

What distribution? Try the command 'locate php.ini'

Cent OS 4. It says, /etc/php.ini, but nothings there..

try

/etc/php/php.ini

/etc/php5/php.ini

or you can just do

updatedb

and locate php.ini

Hi,

A search on Google for php.ini and CentOS yielded this:

By "default php.ini should be installed at /usr/local/lib/php.ini"…

"Unless you're running Zend, in which case the file at /usr/local/lib/php.ini should be a symbolic link to /usr/local/Zend/etc/php.ini"

I have no access to a CentOS machine but try those. If those do not work but your PHP is working, try a test script (say phptest.php):

and open it via your browser (http://localhost/phptest.php or http://your_linode/phptest.php). It will tell you, among other things, what php.ini file it's reading the configs from.

Cheers,

Antonio

php.ini may be in several different places depending on what you're using it for.

Chances are, though, the one you want will be /etc/php4/apache2/php.ini or similar. Notice the Apache-specific name - if you're using mod_php with Apache 2.x (and most people are), then this is the one you want. It might be in a different directory depending on the distribution (this example is from Debian), but it'll be something along those lines.

Thanks for all the help!

Ok i got it, I have to edit it with nano, but why wont' the file show up through SFTP?

If you're going to use nano to edit the file, why don't you just SSH into the box directly and run it from the prompt?

@sublimice:

Thanks for all the help!

Ok i got it, I have to edit it with nano, but why wont' the file show up through SFTP?
Check the settings on the client you're using

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