Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

no php.ini file? Apache module? 1

Status
Not open for further replies.

AlbertAguirre

Programmer
Nov 21, 2001
273
US
I attempted to make a change to php.ini and discovered that it doesnt exist on my webserver.

I spoke to the admin and he tells me that php wasnt installed, he is using the apache php module. He is new to php and apache.

What does this mean?

How can I change the php config if this is true?

 
Whether PHP is run from the command-line or whether it is run as an Apache module, PHP still needs a php.ini file.

I don't know how he installed PHP, but I have installed PHP both as an RPM module and from source tarball. Both install processes included installing a php.ini file into the right place.



Want the best answers? Ask the best questions! TANSTAAFL!
 
i thought that php can run without an ini file, it implies default values in the absence of expressly set values.

in windows, php will create a default php.ini in the c:\win32 directory, but my experience on a mac suggests that it doesn't bother with at least the mac variant of *nix.
 
Perhaps I was unclear.

Yes, PHP will run without a php.ini file. Doing so, however, is not proven to be safe, particularly on a machine connected to the internet. I don't know what all the possible defaults built into software are, but the source tarball contains php.ini-dist and php.ini-recommended. It seems reasonable to assume from the presence of these two files that the programmers don't think the software's defaults are maximally safe. Hence, PHP needs a php.ini.





Want the best answers? Ask the best questions! TANSTAAFL!
 
Oh ok well that makes sense. The person who installed it is new to this...

OK so if I create a php.ini file then where should I put it? Whats the default location?
 
I would ask PHP....

Create a PHP script that consists of:

Code:
<?php
phpinfo()
>?

And run it by pointing your browser to it. There will be a section near the beginning of the output of that script that reads "Configuration File (php.ini) Path". Put php.ini where PHP expects it.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top