Page 1 of 1

where to put php extensions

Posted: Wed Oct 11, 2006 10:57 am
by raghavan20
i have fedora core 5 and i have never installed webserver/php in Linux; just used it all these years!

actually i thought of installing apache and php using rpms but i came to see that they are pre-installed.
The httpd is working and php is working as well.


I have a few clarifications now:

1. when i see the httpd.conf file in /etc/httpd/conf/httpd.conf, i cannot see any line that adds module to execute php files eventhough i see the MIME type added


2. I need to load extensions for php like this one
extension=php_domxml.dll

and when i was looking at php.ini i see that there is no extension line mentioned? now my questions are
2.1 where should i create extensions directory in system optimally?
2.2. where can i get the .so files which are extensions for Linux?
2.3. how do I install PEAR from here?


3. My Linux system does not have internet connection so do you think this will be a problem when using PEAR because I am trying to use symfony framework and I doubt symfony framework might try to download packages dynamically?

[EDITED]
3.2. PEAR is not installed so far; the last time I installed in Windows, there was a go-pear file which downloaded the PEAR manager and i then used PEAR manager to download packages but this system does not have internet connection so how do I install package manager?

do you guys also suggest me to directly download the packages instead of going through PEAR manager?


4. since httpd is pre-installed, I do not really know how to start or stop the process? It does not appear to be installed as service because I tried this and it does not work
service start apache


5. how to add apache as service so that is starts up when system is started?


Any help would be deeply appreciated.

Posted: Wed Oct 11, 2006 11:09 am
by RobertGonzalez
FC5 Changed the way extensions are loaded for PHP. Your php.ini file should be in /etc/php.ini. The modules are loaded by way of their own .ini files that are located in /etc/php.d/. the extensions folder is /usr/lib/php/modules/ to the best of my knowledge.

Posted: Wed Oct 11, 2006 11:15 am
by raghavan20
Everah wrote:FC5 Changed the way extensions are loaded for PHP. Your php.ini file should be in /etc/php.ini. The modules are loaded by way of their own .ini files that are located in /etc/php.d/. the extensions folder is /usr/lib/php/modules/ to the best of my knowledge.
thanks for your reply everah,,,do you advise me to put all the extensions in /usr/lib/php/modules. Can you tell me where can I get other .so files from?

I do not understand the other .ini files in /etc/php.d/. If you dont mind, can you tell where those are used?

Posted: Wed Oct 11, 2006 11:25 am
by RobertGonzalez
The other ini files are the parts of (what you would usually expect to be the extensions part of) php.ini. So the other ini files look like:

Code: Select all

; Enable mysqli extension module
extension=mysqli.so
These files are read into the php.ini file at runtime and execute the extension enabling. As for getting other extensions, I have just RPM'ed them from various RPM repositories or from the FC repository.

Posted: Wed Oct 11, 2006 7:07 pm
by Jenk
raghavan20 wrote:
Everah wrote:FC5 Changed the way extensions are loaded for PHP. Your php.ini file should be in /etc/php.ini. The modules are loaded by way of their own .ini files that are located in /etc/php.d/. the extensions folder is /usr/lib/php/modules/ to the best of my knowledge.
thanks for your reply everah,,,do you advise me to put all the extensions in /usr/lib/php/modules. Can you tell me where can I get other .so files from?

I do not understand the other .ini files in /etc/php.d/. If you dont mind, can you tell where those are used?
Your httpd.conf will have the line:

Code: Select all

Include /etc/php.d/*.conf
somewhere (or just php.d/*.conf)

Posted: Wed Oct 11, 2006 7:25 pm
by RobertGonzalez
Mine doesn't. But it does have this

Code: Select all

#
# Load config files from the config directory "/etc/httpd/conf.d".
#
Include conf.d/*.conf
Then, in the /etc/httpd/conf.d directory it has a php.conf file that looks like this

Code: Select all

#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php5_module modules/libphp5.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps

Posted: Wed Oct 11, 2006 7:57 pm
by Jenk
fyi - that's setup to run all pages via php-cgi.

Change your AddType line to:

Code: Select all

AddType application/x-httpd-php .php
and then scrap the AddHandler line all together for a more efficient setup :)

Posted: Wed Oct 11, 2006 8:08 pm
by RobertGonzalez
Thanks Jenk. I'll look into it. Will I still be able to run PHP from the CLI if I do that?

Posted: Wed Oct 11, 2006 9:09 pm
by Jenk
Yes, the php cli is independant of Apache :)