Solved

phpinfo include_path, extension_dir is wrong: php 5.4

Posted on 2012-03-30
6
2,432 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
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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pass foreach data in php into jquery ajax 10 46
PHP function parameters defined 14 40
How to use session variables in php? 22 46
Increase counter and attr inside a while loop 15 35
This article discusses four methods for overlaying images in a container on a web page
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

749 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