Upgraded PHP from 4.3.4 to 4.3.10 and now it won't read php.ini
Linux - SoftwareThis 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.
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.
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.
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
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?
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.
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.
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.
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:
(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.
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.