Page 2 of 4

Posted: Mon Nov 20, 2006 3:32 pm
by RobertGonzalez
Does anything here sound like it could be to blame?

Posted: Mon Nov 20, 2006 3:36 pm
by ivj
No, since phpinfo() displays the path to the file I'm editing, which's the ONLY php.ini file on my filesystem.

Posted: Mon Nov 20, 2006 3:48 pm
by RobertGonzalez
ivj wrote:You're PHP pros here, tell me something, how can I "turn off" php without httpd.conf by messing up php.ini?
If you want to turn PHP 'off', remove the line in your httpd.conf file that tells apache to parse .php files through the PHP parser. Otherwise you will always get php files getting sent to the PHP engine.

Can you post a link to your PHP info page and specify again what exactly it is you are trying to accomplish?

Posted: Mon Nov 20, 2006 3:57 pm
by feyd
Note: there is an engine off directive that can be set in .htaccess files, if memory serves.

Posted: Mon Nov 20, 2006 4:02 pm
by ivj
Everah wrote:
ivj wrote:You're PHP pros here, tell me something, how can I "turn off" php without httpd.conf by messing up php.ini?
If you want to turn PHP 'off', remove the line in your httpd.conf file that tells apache to parse .php files through the PHP parser. Otherwise you will always get php files getting sent to the PHP engine.
Even if I set Engine=Off in php.ini? I tried that, but like I said, php.ini isn't being read.

"Can you post a link to your PHP info page and specify again what exactly it is you are trying to accomplish?"

There ya go:

http://thailandhaven.com/test.php

And Like I said before, no matter what I do with

Configuration File (php.ini) Path /usr/local/apache2/conf/extra/php.ini

(delete/ modify it with bad syntax, change things in it with right syntax), it's as if that file wasn't read/reloaded whatsoever.

Posted: Mon Nov 20, 2006 4:11 pm
by RobertGonzalez
One last test... try enabling another extension... for example, mysqli. Restart apache and reload the php.ini page to see if that change took effect.

PS | Again, what is it you are trying to accomplish by way of editing your php.ini file?

Posted: Mon Nov 20, 2006 4:48 pm
by volka
What does

Code: Select all

<?php
$inipath = '/usr/local/apache2/conf/extra/php.ini';


echo "<pre>\n";
$path = '';
foreach( explode('/', substr($inipath,1)) as $p ) {
	$path .= '/'.$p;
	if (!file_exists($path)) {
		echo "no such file: $path\n";
	}
	else {
		echo is_dir($path)  ? 'd' :'-',
			is_readable($path)  ? 'r' :'-',
			is_writable($path)  ? 'w' :'-',
			is_executable($path)  ? 'x' :'-',
			" $path\n";
	}
}
$ini = parse_ini_file($inipath, false);
echo "\nentries parsed: ", count($ini), "\n";
foreach( array('engine', 'log_errors', 'error_log', 'error_reporting') as $e) {
	echo $e, ': ', (isset($ini[$e])) ? $ini[$e] : '-undefined-', "\n";
}
echo "</pre>\n";
?>
print?

Posted: Mon Nov 20, 2006 5:06 pm
by ivj
http://thailandhaven.com/test.php

That's what it prints.

Posted: Mon Nov 20, 2006 5:11 pm
by volka
dr-x /usr
dr-x /usr/local
dr-x /usr/local/apache2
dr-x /usr/local/apache2/conf
dr-x /usr/local/apache2/conf/extra
-r-- /usr/local/apache2/conf/extra/php.ini

entries parsed: 149
engine: 1
log_errors: 1
error_log: -undefined-
error_reporting: 2047
Looks good to me.
Now set a value for error_log in /usr/local/apache2/conf/extra/php.ini
e.g.

Code: Select all

error_log=/usr/local/apache2/php.err
restart the apache and run the script again.

Posted: Mon Nov 20, 2006 5:17 pm
by ivj
Hmmm. I get the file does get parsed, look here now: http://thailandhaven.com/test.php

However, I don't see no php.err in that directory...

The reason I'm doing this whole thing was because I was trying to use the PHPMailer library and it was bitching about my timezone not being set, and no matter what I tried, it remained America/New_York, and If I tried setting it in that file, it still wouldn't change....

But still, why don't I see the error log file? It says I Have errors...

Posted: Mon Nov 20, 2006 5:18 pm
by RobertGonzalez
PHP errors show up in your apache error logs.

Posted: Mon Nov 20, 2006 5:19 pm
by volka
It still says
Configuration
PHP Core
[...]
error_log no value no value
You did restart the apache service?

Probably something like

Code: Select all

/etc/init.d/apache stop
/etc/init.d/apache start
?

edit: ah FC4 ->

Code: Select all

/sbin/service httpd stop
/sbin/chkconfig httpd on
/sbin/service httpd start

Posted: Mon Nov 20, 2006 5:21 pm
by ivj
Actually my apache/logs/error_log is very clean. Ok I don't get this, in my php.ini I have

[Date]
date.timezone = "America/Vancouver"


However, when I check the timezone, I get America_NewYork: http://thailandhaven.com/test.php

The code is:

Code: Select all

echo "<br>Timezone (set as \"America/Vancouver\" in php.ini: <b>".date("e")."</b><br>";
Any idea?

Posted: Mon Nov 20, 2006 5:22 pm
by ivj
volka wrote:It still says
Configuration
PHP Core
[...]
error_log no value no value
You did restart the apache service?

Probably something like

Code: Select all

/etc/init.d/apache stop
/etc/init.d/apache start
?

edit: ah FC4 ->

Code: Select all

/sbin/service httpd stop
/sbin/chkconfig httpd on
/sbin/service httpd start
Huh? Refresh the file, here's what I'm seeing:

entries parsed: 150
engine: 1
log_errors: 1
error_log: /usr/local/apache2/logs/php.err
error_reporting: 2047

Posted: Mon Nov 20, 2006 5:25 pm
by volka
That's what parse_ini_file returns.
Scroll down to the phpinfo() section - that's what php is bothering about, not some call to parse_ini_file ;)