Solved

phpinfo include_path, extension_dir is wrong: php 5.4

Posted on 2012-03-30
6
2,331 Views
Last Modified: 2012-04-05
Hi,

I compiled php 5.4 from source on my Centos 5.x system. Everything seemed to go okay. But when I look at my phpinfo() output my:

extension_dir =       /usr/local/bin/php/lib/php/extensions/debug-non-zts-20100525
include_path =       .:/usr/local/bin/php/lib/php

Configuration File (php.ini) Path = /usr/local/lib/php
Loaded Configuration File  = /usr/local/lib/php.ini

But in my php.ini file has:
include_path = ".:/usr/local/lib:/usr/lib64/php"
extension_dir = "/usr/lib64/php/modules"

Where is the phpinfo() getting this information from?

Victor
0
Comment
Question by:Victor Kimura
  • 3
  • 2
6 Comments
 
LVL 9

Assisted Solution

by:Shaun McNicholas
Shaun McNicholas earned 500 total points
Comment Utility
Well the configuration has to be loading from /usr/local/lib/php.ini
That's what the output from phpinfo() says.

Are you certain this is the php.ini file you are looking at?

Also make sure your paths are not commented with a starting character of ;

If you search the php.ini file see what the default is on your install - it may just loading the defaults because your config changes still have those lines commented with a semi colon.
Just remove the semicolon and see if that fixes it.

If it still says its loading with those same paths then maybe you don't have apache pointed to the php install that you think its pointing to.
0
 

Author Comment

by:Victor Kimura
Comment Utility
I have this in my /usr/local/lib/php.ini (made double sure of it):
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
;extension_dir = "/usr/local/include/php/ext"
extension_dir = "/usr/lib64/php/modules"

; PHP's default setting for include_path is ".;/path/to/php/pear"
; http://php.net/include-path
include_path = ".:/usr/local/lib:/usr/lib64/php"

I have this in my /usr/local/apache/conf/httpd.conf:

NameVirtualHost *

<VirtualHost *>
    ServerAdmin admin@howtomarketyourstuff.com
    ServerName localhost
    PHPIniDir /usr/local/lib/php.ini
    DocumentRoot /usr/local/apache/htdocs/
    ErrorLog logs/localhost-error_log
    CustomLog logs/localhost-access_log common
</VirtualHost>


I checked to see if there are any other php.in files since the default for Centos is /etc/php.ini so I renamed it to /etc/php_backup.ini and then stopped and started apache. But the phpinfo() is the same.

Here is the output for a find for all php.ini files:
[root@seokingdomheaven etc]# find / -name php.ini
/home/vkimura/ZendStudio/plugins/com.zend.php.debug.debugger.linux.x86_64_5.3.18.v20111214/resources/php53/php.ini
/home/vkimura/eclipse/plugins/org.zend.php.debug.debugger.linux.x86_64_5.3.7.v20091124/resources/php5/php.ini
/home/vkimura/eclipse/plugins/org.zend.php.debug.debugger.linux.x86_64_5.3.7.v20091124/resources/php53/php.ini
/usr/local/lib/php.ini
/root/Downloads/eclipse/plugins/org.zend.php.debug.debugger.linux.x86_5.2.15.v20081217/resources/php4/php.ini
/root/Downloads/eclipse/plugins/org.zend.php.debug.debugger.linux.x86_5.2.15.v20081217/resources/php5/php.ini
/root/Downloads/eclipse/plugins/org.zend.php.debug.debugger.win32.x86_5.2.15.v20081217/resources/php4/php.ini
/root/Downloads/eclipse/plugins/org.zend.php.debug.debugger.win32.x86_5.2.15.v20081217/resources/php5/php.ini
/root/Downloads/eclipse/plugins/org.zend.php.debug.debugger.macosx_5.2.15.v20081217/resources/php4/php.ini
/root/Downloads/eclipse/plugins/org.zend.php.debug.debugger.macosx_5.2.15.v20081217/resources/php5/php.ini

What am I missing?
0
 
LVL 9

Assisted Solution

by:Shaun McNicholas
Shaun McNicholas earned 500 total points
Comment Utility
Do a find for httpd.conf
Maybe the apache config you think you're loading isn't the one that currently running. Of course I think the pho info report would tell you which apache is running. I'm just thinking that's the only logical explanation.

I know on my Mac I have 2 apaches installed one from mocports and then other that's standard Mac os iteration.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 15

Expert Comment

by:babuno5
Comment Utility
hey did u restart your web server apache after making change in php.in file just want to double ensure
0
 

Accepted Solution

by:
Victor Kimura earned 0 total points
Comment Utility
Hi fellas.

Thanks for your insight and input. I found out that this file:
I have this in my /usr/local/apache/conf/httpd.conf:

NameVirtualHost *

<VirtualHost *>
    ServerAdmin admin@howtomarketyourstuff.com
    ServerName localhost
    PHPIniDir /usr/local/lib/php.ini
    DocumentRoot /usr/local/apache/htdocs/
    ErrorLog logs/localhost-error_log
    CustomLog logs/localhost-access_log common
</VirtualHost>

The part:
PHPIniDir /usr/local/lib/php.ini

needs to be in quotes like:
PHPIniDir "/usr/local/lib/php.ini"

But I also took that line outside of the <VirtualHost> tags just before NameVirtualHost *

Then stopped and started. I find sometimes restarting doesn't do the trick and stopping and starting it better when making some changes.

Thank you for your help. =)
0
 

Author Closing Comment

by:Victor Kimura
Comment Utility
The part:
PHPIniDir /usr/local/lib/php.ini

needs to be in quotes like:
PHPIniDir "/usr/local/lib/php.ini"
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now