Apache (httpd.conf) vs. PHP.ini

TommyWillB

Registered
Okay... I thought I had this figured out, but now I'm confused all over again.

There are some other threads that talk about the PHP.ini in Jaguar, but they all say the file needs to be at /usr/local/lib and my "phpinfo()" shows the config path as /usr/lib.

Independant of that I'm also confused as to what belongs in the PHP.ini and what can go in the Apache http.conf <IfModule mod_php4.c> section.

I'm trying to set the PHP user_agent, but nothing I try seems to work. In the Apache httpd.conf file I've tried all of these variations (not at once):
Code:
<IfModule mod_php4.c>
 php_admin_value user_agent "TommyWillB Agent"
	php_value user_agent "TommyWillB Agent"
	php_flag user_agent "TommyWillB Agent"	
</IfModule>
In both /usr/local/lib/php.ini and /usr/lib/php.ini I've tried:
Code:
user_agent="Tom Agent"
I've tried stopping/starting Apache from the Sharing Preferences Pane, and by using "apachectl restart"... (I'm not clear if there is a seperate way to stop/restart PHP?)

None of these things have changed the HTTP_USER_AGENT PHP sends when it opens a file over HTTP. It continues to report its agent as "PHP/4.1.2".

The probelm here is that the page I am trying to get only renders pages for IE, so I need to send that agent...

Help!
 
If your phpinfo() says the php.ini file is supposed to be in /usr/lib then your server agrees with mine.

Generally, if you're going to set your php_values inside the httpd.conf file you should do so in a "Location" or "Directory" container.

Finally, if you're having trouble with setting the User-Agent http header value then read the comments on this page for some clever workarounds.
 
Back
Top