Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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 have CentOS 6.2 (upgraded to 6.3) installed on our server.
I have LAMP running on it too.
The installed PHP Version 5.4.6
The installed Apache version is: 2.2.15
I am currently trying to get json installed but running into problems running phpize
Here's what I have done so far:
Code:
[root@myserver1 tmp]# pecl install json
downloading json-1.2.1.tgz ...
Starting to download json-1.2.1.tgz (17,780 bytes)
......done: 17,780 bytes
11 source files, building
running: phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
ERROR: `phpize' failed
When I do: "yum install m4",I get
"Package m4-1.4.13-5.el6.i686 already installed and latest version
Nothing to do"
The following commands return nothing:
1#. yum search php | grep json
2#. cd / find -name 'config.m4'
Yet, "yum install m4" gives me
"Package m4-1.4.13-5.el6.i686 already installed and latest version
Nothing to do"
json is compiled-in by default for php-5.2.20 and above.
I see that you've disabled it in your 1st ./configured options, but the output of "php -i" shows it's enabled. The phpinfo ./configure line also says that you've enabled json as a shared module (--enable-json=shared). In this case you might need to add in php.ini
Code:
extension=json.so
if it's not already there.
Anyway from the 2 different ./configure options posted, looks like the 1st one is for php installed as a fast-cgi, while the 2nd is for php installed as an apache DSO. Dunno which one you use, so check httpd.conf. I guess your're using the DSO, that's why phpinfo shows json enabled.
BTW
Quote:
PHP: syntax error, unexpected BOOL_FALSE in /etc/php.ini on line 1001
Thanks a lot @bathory
I have added "extension=json.so"
but, I am unable to figure out the BOOL-FALSE error.
[root@myserver1]# php -i | grep 'json support'
PHP: syntax error, unexpected BOOL_FALSE in /etc/php.ini on line 1002
json support => enabled
[root@myserver1]#
Here's the portion of php.ini being referred to:
Code:
1001 [Pdo]
1002 ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
1003 ; http://www.php.net/manual/en/ref.pdo-odbc.php#ini.pdo-odbc.connection-pooling
1004 ;pdo_odbc.connection_pooling=strict
1005
1006 [Phar]
1007 ; http://www.php.net/manual/en/phar.configuration.php#ini.phar.readonly
1008 ;phar.readonly = On
1009
1002 is a commented line, don't see why it should cause an error.
I would still appreciate some help as the server setup still does not parse PHP files correctly.
Here's what I get when I try to view a PHP based website:
"Server error
The website encountered an error while retrieving http://mywebsite.com/. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request."
...
.....
...........
[21-Aug-2012 14:41:03 UTC] PHP Warning: Module 'OAuth' already loaded in Unknown on line 0
[21-Aug-2012 14:46:03 UTC] PHP Warning: Module 'json' already loaded in Unknown on line 0
[21-Aug-2012 14:46:03 UTC] PHP Warning: Module 'OAuth' already loaded in Unknown on line 0
[21-Aug-2012 14:46:03 UTC] PHP Warning: Module 'json' already loaded in Unknown on line 0
[21-Aug-2012 14:46:03 UTC] PHP Warning: Module 'OAuth' already loaded in Unknown on line 0
[21-Aug-2012 14:51:02 UTC] PHP Warning: Module 'json' already loaded in Unknown on line 0
[21-Aug-2012 14:51:02 UTC] PHP Warning: Module 'OAuth' already loaded in Unknown on line 0
[21-Aug-2012 14:51:02 UTC] PHP Warning: Module 'json' already loaded in Unknown on line 0
[21-Aug-2012 14:51:02 UTC] PHP Warning: Module 'OAuth' already loaded in Unknown on line 0
I believe some of these errors were being caused by these lines in php.ini. I have commented them out and restarted Apache..
Code:
...
.....
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
extension=apc.so
;extension=oauth.so
;extension=json.so
I have done this but the error still remains..
Thanks
[Tue Aug 21 14:53:47 2012] [notice] seg fault or similar nasty error detected in the parent process
Doh, apache segfaults somehow, but the log doesn't say much. To see if it's php the culprit, comment out the line:
Quote:
LoadModule php5_module ...
Then stop and start again apache to check.
Quote:
[21-Aug-2012 14:41:03 UTC] PHP Warning: Module 'OAuth' already loaded in Unknown on line 0
[21-Aug-2012 14:46:03 UTC] PHP Warning: Module 'json' already loaded in Unknown on line 0
These are just warnings. The modules are already loaded in php maybe by some other file (check /etc/php.d/*.conf or /etc/php.d/*.ini).
So, I did a search and saw that I have these two files
(1) libphp5.so
(2) libphp5-zts.so
at this location:
/usr/lib/httpd/modules/
so, I added them to httpd.conf like this:
LoadModule php5_module /usr/lib/httpd/modules/libphp5.so
LoadModule php5_module /usr/lib/httpd/modules/libphp5-zts.so
Restarted Apache, but it doesn't seem to have had any effect. I am still getting
Code:
Server error
The website encountered an error while retrieving http://mywebsite.com/. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
I also observed that I am getting
Code:
[root@myserver1 modules]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [Wed Aug 22 07:42:21 2012] [warn] module php5_module is already loaded, skipping
So, I did a search and saw that I have these two files
(1) libphp5.so
(2) libphp5-zts.so
at this location:
/usr/lib/httpd/modules/
so, I added them to httpd.conf like this:
LoadModule php5_module /usr/lib/httpd/modules/libphp5.so
LoadModule php5_module /usr/lib/httpd/modules/libphp5-zts.so
In Centos the php module is loaded from /etc/httpd/conf.d/php.conf.
You cannot load both as the 1st one is loaded when apache runs in prefork mode (the default) and the other is for apache.worker.
Besides I've told you to comment out the php module loading, to check if that's giving the segfault.
I commented out this line:
# AddHandler php5-script .php
and the PHP page got displayed, but with php code showing on the pages..
Here's the content of my php.conf file (which is located here: /etc/httpd/conf.d)
Code:
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule !prefork.c>
LoadModule php5_module modules/libphp5-zts.so
</IfModule>
#
# Cause the PHP interpreter to handle files with a .php extension.
#
# AddHandler php5-script .php
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps
Here's what my /var/log/httpd/error_log file looks like:
I commented out this line:
# AddHandler php5-script .php
I told you to comment out the "LoadModule ..." line, so apache stops loading the php module, so we can verify if it's the culprit for the apache segfaults. I suspect it is, because it's of the php you've compiled yourself.
Quote:
Here's what my /var/log/httpd/error_log file looks like:
<snip>
Do you have a clue what this all means?
This is a backtrace of the apache segfaulting. I guess it's because of the php but cannot be sure.
BTW why don't you uninstall your php and install the centos php package? Is there any particular reason you want to use the latest php?
..not really. I must have updated PHP to the latest version while trying to troubleshoot.
I have a question/concern though: how does installing the centOS version of PHP affect my php.ini file?
Also, would you be kind enough to share the command for installing?
I am assuming it would be:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.