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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-17-2005, 01:31 AM
|
#1
|
Member
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54
Rep:
|
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.
|
|
|
01-17-2005, 02:51 AM
|
#2
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,221
|
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
|
|
|
01-17-2005, 11:35 AM
|
#3
|
Member
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54
Original Poster
Rep:
|
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?
|
|
|
01-18-2005, 01:56 AM
|
#4
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,221
|
Did you copy the sample php.ini-recommended to /usr/local/lib and restart apache?
|
|
|
01-18-2005, 03:36 AM
|
#5
|
Member
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54
Original Poster
Rep:
|
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?
|
|
|
01-20-2005, 09:15 PM
|
#6
|
Member
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54
Original Poster
Rep:
|
Is my only option now to reformat the hard drive and reinstall Redhat 9.0 (or more likely, Fedora 3.0)?
|
|
|
01-21-2005, 02:02 AM
|
#7
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,221
|
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
|
|
|
01-21-2005, 08:53 AM
|
#8
|
Member
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54
Original Poster
Rep:
|
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.
|
|
|
01-21-2005, 09:08 AM
|
#9
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,221
|
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.
|
|
|
01-21-2005, 11:14 PM
|
#10
|
Member
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54
Original Poster
Rep:
|
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.
|
|
|
01-22-2005, 03:10 AM
|
#11
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,221
|
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.
|
|
|
01-22-2005, 12:16 PM
|
#12
|
Member
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 12:36 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|