1

I got a server that runs : PHP Version 5.5.9-1 ubuntu 4.9

I wanted to edit the "correct" php.ini file so i can enable some features. First of all i used:

root@server ~ # find / -name php.ini

/opt/psa/admin/conf/php.ini
/opt/plesk/php/5.3/etc/php.ini
/opt/plesk/php/5.5/etc/php.ini
/opt/plesk/php/5.4/etc/php.ini
/opt/plesk/php/5.6/etc/php.ini
/var/www/vhosts/system/mysiteyo/etc/php.ini
/etc/php5/cgi/php.ini
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini
/etc/psa-webmail/horde/horde/php.ini
/etc/psa-webmail/roundcube/php.ini

I read from a previous thread that i should edit the /etc/php5/apache2/php.ini file.

I also created a phpinfo(); script and run it from my browser. The configuration file Path @ phpinfo was the /etc/php5/cgi/php.ini but the loaded configuration file was :

/var/www/vhosts/system/mysiteyo/etc/php.ini 

As i opened the above file i saw this:

; ATTENTION! ;  
; DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY, 
; SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

So i thought that this file is somehow genarated from one of the other php.ini files.

Then i renamed both files (/etc/php5/cgi && /etc/php5/apache2) as php_tmp.ini and loaded my new modified php.ini file.

After that i restarted apache2:

root@server ~ # /etc/init.d/apache2 restart

Altough as i rerun the phpinfo(); script , i cant see any changes. i changed kinda half of the scripts i found with the find command, but i got the feeling that im doing something completly wrong. Could someone enlightment if i missed something, or if im doing something wrong?I think that this auto-generated file is the problem but i dont know from where it is getting generated to edit that file. Thanks for your time.

0

You've identified the correct php.ini file where you're configuration options are coming from. Its the file shown in the output of phpinfo(), which in your case is /var/www/vhosts/system/mysiteyo/etc/php.ini.

If you were to modify that file and restart Apache, then you should see your changes in the output of phpinfo().

The problem you have is the file is autogenerated, so any changes you make will not be persistent. The question you need to answer is, what is generating that file and how is it doing it? My guess would be that you have some form of control panel, such as cPanel or Plesk which is creating the /var/www/vhosts/system/mysiteyo/etc/php.ini file.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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