php.ini configuration changes in shared hosting account
Am trying to override the default php.ini configuration using .htaccess / ini_set, but the configurations are not getting reflected while executing the scri开发者_运维百科pt. Here the PHP is installed as fastcgi and am in a shared hosting account. Is there any way to change the php.ini settings or I need to upgrade my account to virtual dedicated server. Please help in this regard.
Thanks for your answers, to be more elaborate, i want to change the max_execution_time of my php script as am handling with a huge log file need to be parsed. This script exceeds the default configuration in php.in (i.e) 30 secs. As my site is in the shared hosting, am not able to configure it in php.ini, they given a (php.ini)file in the document root ans ask us to configure the values but that is not reflecting.I tried the dynamic way using ini_set, same result.
The include path is .:/usr/local/php5/lib/php
I doubt you will be able to modify everything in the php.ini
file on a shared host. The host could've turned the whole ini_set()
function off for all I know! A virtual dedicated server might be what you're looking for (I have never encountered this stuff, as I run my own servers).
Just wondering, what are you trying to set?
Try to create a new php.ini file in the directory from where you are executing your script with your required php.ini environment variables.. Also, if it's cPanel hosting that you are using.. there's one more setting that you need to change in the cPanel.. you might be allowed access to turn this setting on or off depending on your web host. I'll post the setting in a moment.. Please confirm if you use cPanel hosting?
For most shared hosting environments, having a copy of php.ini file in your public_html directory works to override the system default settings. A great way to do this is by copying the hosting company's copy. Put this in a file, say copyini.php
<?php
system("cp /path/to/php/conf/file/php.ini /home/yourusername/public_html/php.ini");
?>
Get /path/to/php/conf/file/php.ini from the output of phpinfo(); in a file. Then in your ini file, make your amendments Delete all files created during this process (Apart from php.ini of course :-) )
精彩评论