Solved

phpinfo include_path, extension_dir is wrong: php 5.4

Posted on 2012-03-30
6
2,488 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 9

Assisted Solution

by:Shaun McNicholas
Shaun McNicholas earned 500 total points
ID: 37786436
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
ID: 37786514
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
ID: 37787302
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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
LVL 15

Expert Comment

by:babuno5
ID: 37787492
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
ID: 37790632
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
ID: 37810011
The part:
PHPIniDir /usr/local/lib/php.ini

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

615 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