LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-17-2005, 01:31 AM   #1
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Rep: Reputation: 15
Upgraded PHP from 4.3.4 to 4.3.10 and now it won't read php.ini


Even when I invoke php without apache:
Code:
# /usr/local/php/bin/php -i
It still shows:
Code:
Configuration File (php.ini) Path => /usr/local/lib
rather than
Code:
/usr/local/lib/php.ini
which would indicate it's actually using that configuration file. php.ini does exist at /usr/local/lib:

Code:
$ ls -la /usr/local/lib/php.ini
-rw-r--r--    1 root     root        38693 Jan 16 23:10 /usr/local/lib/php.ini
I'm running Redhat 9.0 and Apache 2.0.52. Php was ./configured's with:
Code:
# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/lib --with-apxs2=/usr/local/apache2/bin/apxs --enable-track-vars --enable-debugger --with-mysql --with-mysql-sock=/var/lib/mysql/mysql.sock --with-zlib --enable-mbstring --with-gd-dir
I tried chown'ing php.ini to "nobody", but that didn't help. Restarting httpd makes no difference, either; the error shows up in phpinfo.php as well, and changes I make php.ini have no effect. I tried re-installing php (renamed /usr/local/php, /usr/local/lib/php.ini, and /etc/httpd/modules/libphp4.so to ".old" and then re-installed it, but to no avail. Actually, after that it didn't automatically put in a new libphp4.so, but phpinfo() still works on apache. I don't know why.

When I ran php 4.3.4 under Apache 2.0.48 I had no such trouble.
 
Old 01-17-2005, 02:51 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Try to run ./configure without --prefix=.. and --config-dir-path=.. since you use the default directories and see what happens. Or use --prefix=/usr/local.
Regards
 
Old 01-17-2005, 11:35 AM   #3
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Original Poster
Rep: Reputation: 15
Thank you. I tried that suggestion, but still have phpinfo() reporting:

Quote:
Configure Command './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-track-vars' '--enable-debugger' '--with-mysql' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-zlib' '--enable-mbstring' '--with-gd-dir'
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/lib
Other ideas?
 
Old 01-18-2005, 01:56 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Did you copy the sample php.ini-recommended to /usr/local/lib and restart apache?
 
Old 01-18-2005, 03:36 AM   #5
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Original Poster
Rep: Reputation: 15
Yes, I did. And I made sure libphp4.so got to the right place (/etc/httpd/modules, not /usr/local/apache2/modules; though I left a copy there, too, just in case). Php 4.3.10 runs, but doesn't recognize the php.ini file. And again, even when I run php directly (without httpd), I get the same problem:

Quote:
# ./php -i
phpinfo()
PHP Version => 4.3.10

System => Linux XXXXXXXX 2.4.20-31.9 #1 Tue Apr 13 18:04:23 EDT 2004 i686
Build Date => Jan 16 2005 22:53:46
Configure Command => './configure' '--prefix=/usr/local/php' '--with-config-file-path=/usr/local/lib' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-track-vars' '--enable-debugger' '--with-mysql' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-zlib' '--enable-mbstring' '--with-gd-dir'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lib
PHP API => 20020918
PHP Extension => 20020429
Zend Extension => 20021010
Debug Build => no
Thread Safety => disabled
Registered PHP Streams => php, http, ftp, compress.zlib


This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
etc.
Perhaps something in the php.ini file is invalid, causing it to be rejected entirely? The only change I generally made is changing the memory allocation in Resources to 12M from 8M. Is there a command I can give php to check a config file? Is there a place where an error would be logged?

Or has anyone another idea about what could be causing the problem?
 
Old 01-20-2005, 09:15 PM   #6
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Original Poster
Rep: Reputation: 15
Is my only option now to reformat the hard drive and reinstall Redhat 9.0 (or more likely, Fedora 3.0)?
 
Old 01-21-2005, 02:02 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You don't need to reformat for this reason. Php is working as you say and the only strange thing is that it doesn't recognize php.ini. I would suggest to install Zend optimizer (http://zend.com/store/products/zend-optimizer.php) which changes php.ini and see what happens.

Regards
 
Old 01-21-2005, 08:53 AM   #8
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Original Poster
Rep: Reputation: 15
phpinfo() shows that it's using zend already. When I do install the latest version of Zend, it does change the php.ini file, but again, php isn't reading that php.ini, so it doesn't take effect.
 
Old 01-21-2005, 09:08 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Zend optimizer is not installed by default. When you install it it shows this:
Quote:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with Zend Extension Manager v1.0.6, Copyright (c) 2003-2004, by Zend Technologies
with Zend Optimizer v2.5.7, Copyright (c) 1998-2004, by Zend Technologies
Anyway looking again at your ./config options you give --enable-debugger while the ./config --help says that --enable-debug is the correct option to compile with debugging options. Change it accordingly to see if that's the case.
 
Old 01-21-2005, 11:14 PM   #10
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Original Poster
Rep: Reputation: 15
Good catch. I tried it with --enable-debug instead and restarted httpd. Now php -i yeilds:
Quote:
phpinfo()
PHP Version => 4.3.10

System => Linux einstein 2.4.20-31.9 #1 Tue Apr 13 18:04:23 EDT 2004 i686
Build Date => Jan 21 2005 21:04:59
Configure Command => './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-track-vars' '--enable-debug' '--with-mysql' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-zlib' '--enable-mbstring' '--with-gd-dir'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lib
PHP API => 20020918
PHP Extension => 20020429
Zend Extension => 20021010
Debug Build => yes
Thread Safety => disabled
Registered PHP Streams => php, http, ftp, compress.zlib


This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
It still doesn't read php.ini. After I install the most recent copy of Zend and restart httpd, I get:
Quote:
phpinfo()
PHP Version => 4.3.10

System => Linux einstein 2.4.20-31.9 #1 Tue Apr 13 18:04:23 EDT 2004 i686
Build Date => Jan 16 2005 22:53:46
Configure Command => './configure' '--prefix=/usr/local/php' '--with-config-file-path=/usr/local/lib' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-track-vars' '--enable-debugger'
'--with-mysql' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-zlib' '--enable-mbstring' '--with-gd-dir'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lib
PHP API => 20020918
PHP Extension => 20020429
Zend Extension => 20021010
Debug Build => no
Thread Safety => disabled
Registered PHP Streams => php, http, ftp, compress.zlib


This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
Since it's not reading php.ini it's not making use of the newer Zend. Any other ideas?

Last edited by gregmcavoy; 01-21-2005 at 11:16 PM.
 
Old 01-22-2005, 03:10 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You said you installed php with --enable-debug which I can see in the first output of phpinfo() and then installed Zend, but the output of phpinfo() in the second case shows the wrong --enable-debugger as well the --prefix, --config-file-path options!!
I would suggest to remove the directories and files created by your php installation, delete the line about libphp4.so from apache's conf file, delete also the directory you extracted php source and start over. Use something like this:
Quote:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/path/to/mysql --enable-track-vars --with-zlib --enable-mbstring --with-gd-dir --enable-debug
(I use with-mysql=/path/to/mysql because I don't trust the built-in mysql support)
Then copy the example php.ini to /usr/local/lib without changing anything and see what happens.
 
Old 01-22-2005, 12:16 PM   #12
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Original Poster
Rep: Reputation: 15
OK. That worked. I did the same for Zend optimizer 2.5.7 (as recommended on the php and Zend website). It did create the link from the /usr/local/lib/php.ini to its own:
Code:
lrwxrwxrwx    1 root     root           27 Jan 22 07:21 php.ini -> /usr/local/Zend/etc/php.ini
But it doesn't show up yet, though. I can get the configuration file referenced when i run php -i:
Quote:
System => Linux einstein 2.4.20-31.9 #1 Tue Apr 13 18:04:23 EDT 2004 i686
Build Date => Jan 22 2005 07:14:57
Configure Command => './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql=/usr/local/mysql' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--enable-track-vars' '--with-zlib' '--enable-mbstring' '--with-gd-dir' '--enable-debug'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/Zend/etc/php.ini
PHP API => 20020918
PHP Extension => 20020429
Zend Extension => 20021010
Debug Build => yes
Thread Safety => disabled
Registered PHP Streams => php, http, ftp, compress.zlib


This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
However, now Apache won't process php. I verified the configuration file contains these lines:
Quote:
LoadModule php4_module /usr/local/apache2/modules/libphp4.so
AddType application/x-httpd-php .php
And I've verified that I've got the right httpd.conf file modified. I've put a copy of libphp4.so (the one generated by today's build) in /etc/httpd/modules, where the rest of the modules are. It was originall put in /usr/local/apache2/modules, and I left a copy there. I've restarted httpd, but it still isn't processing (as evidenced by Mozilla asking me whether I want to save the file phpinfo.php when I point to it. Should I remove all the httpd files and re-install them, too? I did upgrade to 2.0.52 in the process of trying to get php 4.3.10 to work, and I probably did NOT remove the old folders first.

Also, I thought it would create a /usr/local/php directory with php files. It did not. Under /usr/local/bin I have annotate php, phpize, php-config, pear, and phpextdist; and of course the php.ini file is in the expected place.
I appreciate your help!
--------
An update:
I've no re-compiled Apache, then PHP, then Zend Optimizer. Apache is now processing php (except for my phpinfo.php page, for some reason; other php files are fine). It's also not showing the Zend Optimizer, at least in the command line -i version. However, I've now got a working system, and so I'm going to bed. Thank you for all the help!

Last edited by gregmcavoy; 01-23-2005 at 02:57 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is php.ini? Penguin_5333 Linux - Software 8 09-01-2012 08:19 PM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
php: different mail server from php.ini rayds Programming 0 09-14-2004 03:48 AM
PHP unable to read .php files tuka Linux - Software 6 10-12-2003 06:40 PM
Where's php.ini? XxAndyxX Linux - General 1 06-14-2003 09:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration