-
- 24,544 Posts
Quote from: twz at Sep 18, 2009, 05:56 AM
So I suppose I’ll need to use a copy of the host’s main php.ini, and just change the bits I want??
Either way, it still doesn’t explain why it has been working ok up until now.
Possibly the host’s php.ini changed.
Here’s some code I found to copy the hosts main php.ini and make your modifications to it. I don’t know if it will work at your host:
<?php
// Put all the php.ini parameters you want to change below. One per line.
// Follow the example format $parm[] = "parameter = value";
$parm[] = "register_globals = Off";
$parm[] = "session.use_trans_sid = 0";
// full unix path - location of the default php.ini file at your host
// you can determine the location of the default file using phpinfo()
$defaultPath = "/usr/local/lib/php.ini";
// full unix path - location where you want your custom php.ini file
$customPath = "/home/user/public_html/php.ini";
// nothing should change below this line.
if (file_exists($defaultPath)) {
$contents = file_get_contents($defaultPath);
$contents .= "\n\n; USER MODIFIED PARAMETERS FOLLOW\n\n";
foreach ($parm as $value) $contents .= $value . " \n";
if (file_put_contents($customPath,$contents)) {
if (chmod($customPath,0600)) $message = "The php.ini file has been modified and copied";
else $message = "Processing error - php.ini chmod failed";
} else {
$message = "Processing error - php.ini write failed";
}
} else {
$message = "Processing error - php.ini file not found";
}
echo $message;
?>
-
- 76 Posts
Thanks guys - problem solved. The host put a copy of the main php.ini into /manager/ with the changes I wanted.
Although they still haven’t said what they changed, I suspect the problem started when they installed suhosin (which has many entries in phpinfo() - I don’t remember seeing it there before).
I’ve also grabbed a copy of that code BobRay - for when the host changes something else and it breaks again.
-
- 24,544 Posts
I'd suggest renaming it instead of deleting it. Sometimes (not often) the host puts things in there that are important.
-
- 388 Posts
Thank you BOB.
there was a php.ini because suexec was installed in the server. the hp.ini only has register global off, and that was all. But that php.ini was the trouble!
In my case find that php.ini was MAGIC, because I was looking for info for ages!
but may be if the content is more complex inside the php file, off course it might have something important!
Thank you Bob!
--
ysanmiguel.com
-
- 24,544 Posts
I'm glad I could help.
-
- 388 Posts
Excellent BOB, I see you many times here in the forum, and thank you very much, you are a huge help!!!
--
ysanmiguel.com