[GRLUG] php.ini won't update
Nathan Phillip Brink
binki at gentoo.org
Sat Apr 27 12:05:44 EDT 2013
On Fri, Apr 26, 2013 at 09:33:02PM -0400, Eric Beversluis wrote:
> On Fri, 2013-04-26 at 16:40 -0400, Adam Tauno Williams wrote:
> > > > I restored Xphp.ini-bak to /etc/php.ini, made the changes there, and it
> > > > worked. So something must have corrupted the copied php.ini file I was
> > > > using?
> > > Curious: if the php.ini file was corrupted, why didn't apache crash or
> > > at least, php (and hence the webconfig page and the sugarcrm web
> > > interface) crash? Is there a cached version of php.ini somewhere that
> > > apache was using?
> >
> > If you still have both do a diff and see what the differences are.
> >
> The only difference that seems significant to me is that I uncommented a
> variables_order option in the "Quick Reference Section" rather than
> changing it further down where it is actually set, not realizing that
> where I found it wasn't the place to set it.
>
> So that still leave me with my question, why did it run with the old
> settings rather than just crash?
Did you check apache’s error_log for information from PHP? I think the
default setup would be for php’s errors to go there.
What I expected to happen and what appears to be happening can be
observed by by quickly poking around with my PHP’s CLI. I uncommented
the entire “variables_order” paragraph in the “Quick Reference
Section” of my CLI php.ini and got the following:
ohnobinki at ohnopublishing /tmp/check-0.9.10 $ php -a
PHP: syntax error, unexpected '"' in /etc/php/cli-php5.4/php.ini on line 175
Interactive shell
php > echo ini_get('upload_max_filesize') . PHP_EOL;
2M
php > exit
ohnobinki at ohnopublishing /tmp/check-0.9.10 $ grep -e max_filesize /etc/php/cli-php5.4/php.ini
upload_max_filesize = 20M
ohnobinki at ohnopublishing /tmp/check-0.9.10 $ # as root I fixed the directive
ohnobinki at ohnopublishing /tmp/check-0.9.10 $ php -a
Interactive shell
php > echo ini_get('upload_max_filesize') . PHP_EOL;
20M
The original values in your php.ini were the defaults from the PHP
installation. You can see the default for upload_max_filesize at
http://docs.php.net/upload-max-filesize (scroll up to the “File
Uploads” section heading under which this setting is grouped). The
parsing error was so bad that PHP was unwilling to parse the rest of
the php.ini file in question. The error message, which the CLI writes
to stderr, was (likely) written to apache’s error_log—not to the
browser.
I suggest that you experiment a bit more with php.ini. Put the syntax
error back in on purpose, restart apache, and then look in your logs
for the syntax error message. I was able to find “PHP: syntax error,
unexpected '"' in /etc/php/apache2-php5.4/php.ini on line 136” in my
error_log when purposefully creating a syntax error there. This would
have led you straight to the problem line in the .ini and helped you
avoid a lot of trouble ;-). If you cannot find these errors,
double-check the value of your php.ini’s error_log directive and also
that its log_errors directive is “On”.
--
binki
Look out for missing or extraneous apostrophes!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://shinobu.grlug.org/pipermail/grlug/attachments/20130427/e008c92e/attachment.pgp>
More information about the grlug
mailing list