where to put php extensions
Moderator: General Moderators
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
where to put php extensions
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.
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.
Last edited by raghavan20 on Wed Oct 11, 2006 11:16 am, edited 2 times in total.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
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?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.
I do not understand the other .ini files in /etc/php.d/. If you dont mind, can you tell where those are used?
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
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:
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.
Code: Select all
; Enable mysqli extension module
extension=mysqli.soYour httpd.conf will have the line:raghavan20 wrote: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?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.
I do not understand the other .ini files in /etc/php.d/. If you dont mind, can you tell where those are used?
Code: Select all
Include /etc/php.d/*.conf- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Mine doesn't. But it does have this
Then, in the /etc/httpd/conf.d directory it has a php.conf file that looks like this
Code: Select all
#
# Load config files from the config directory "/etc/httpd/conf.d".
#
Include conf.d/*.confCode: 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 .phpsfyi - that's setup to run all pages via php-cgi.
Change your AddType line to:
and then scrap the AddHandler line all together for a more efficient setup 
Change your AddType line to:
Code: Select all
AddType application/x-httpd-php .php- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA