Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I installed php on the server and php_info(); displays:

Configuration File (php.ini) Path   /home/gmcnulty/php  

However, I don't see anything there nor do I see any php directory?

How do I locate the php directory and specifically the php.ini file?

Thanks.

share|improve this question

2 Answers 2

Try going into /etc and executing find -name "php.ini" This should tell you where php.ini is located.

share|improve this answer
    
listed 6 directories followed by "Permission denied" - guess that mean I can't make changes to it? –  Greg McNulty Jun 17 '12 at 21:43
    
Hm, were you able to find the file you're looking for? The Permission denied message is there probably because you aren't running the command in superuser mode. Try sudo find -name "php.ini" and that should go away. –  superuser Jun 18 '12 at 3:27

If you can access the CLI, typing php --ini will show you which .ini file PHP is trying to load.

It's possible, but unlikely, that you have no php.ini file at all, and could create one in the place that php_info(); suggests.

If you are on shared hosting, you may not be able to navigate highter than /home/gmcnulty, so in this case you should look for the php directory in the highest level you can access.

It is normal for php.ini to live in /etc, but I have also seen it installed in /var/lib before.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.