Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

phpinfo include_path, extension_dir is wrong: php 5.4

Posted on 2012-03-30
6
Medium Priority
?
2,541 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 2000 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 2000 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

688 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