Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Aug 20, 2012 3:12 am 
Offline
Senior Member

Joined: Thu Apr 12, 2012 6:26 am
Posts: 62
Location: Earth
Greetings all,

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"

Echo $PATH gives me
Code:
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin


phpize is actually in usr/bin. While trying to troubleshoot, I have also copied it (phpize) into /usr/local/bin but with no success.

This command "php -v" gives me
Code:
PHP:  syntax error, unexpected BOOL_FALSE in /etc/php.ini on line 1001
PHP 5.4.6 (cli) (built: Aug 16 2012 14:26:44)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies


I would appreciate any help I can get in solving this issue. Google has not offered much help.

Thanks.


Top
   
PostPosted: Mon Aug 20, 2012 5:52 am 
Offline
Senior Member

Joined: Sat Nov 27, 2010 8:21 pm
Posts: 63
json is part of PHP core since 5.2. You should already have it.

Code:
php -i | grep 'json support'


Top
   
PostPosted: Mon Aug 20, 2012 7:35 am 
Offline
Senior Member

Joined: Thu Apr 12, 2012 6:26 am
Posts: 62
Location: Earth
Thanks a lot @Nibbler
You are quite right. Running php -i | grep 'json support' shows that json is enabled, but also throws an unexpected error (BOOL-FALSE), which uable to figure out.

[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 section in 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.


Top
   
PostPosted: Mon Aug 20, 2012 8:55 am 
Offline
Senior Member

Joined: Thu Apr 12, 2012 6:26 am
Posts: 62
Location: Earth
I have been able to fix the error..

The error was from the preceding line

936 extension=apc.so
937 extension=oauth.so"
938 extension=json.so

I removed the " on line 937 and the error disappeared


Top
   
PostPosted: Tue Aug 21, 2012 2:14 am 
Offline
Senior Member

Joined: Thu Apr 12, 2012 6:26 am
Posts: 62
Location: Earth
Help still appreciated 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."

Thanks


Top
   
PostPosted: Tue Aug 21, 2012 3:01 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Check your Apache and PHP logs.


Top
   
PostPosted: Tue Aug 21, 2012 12:18 pm 
Offline
Senior Member

Joined: Thu Apr 12, 2012 6:26 am
Posts: 62
Location: Earth
Thanks a lot @Vance

I am trying to make sense of the php and apache log files..


/var/log/httpd/error_log

Code:
...
....
.....
b720c000-b720d000 rw-p 00007000 ca:00 200922     /usr/lib/httpd/modules/mod_auth_digest.so
b720d000-b720f000 rw-p 00000000 00:00 0
b720f000-b7258000 r-xp 00000000 ca:00 34357      /lib/libfreebl3.so
b7258000-b7259000 r--p 00048000 ca:00 34357      /lib/libfreebl3.so
b7259000-b725a000 rw-p 00049000 ca:00 34357      /lib/libfreebl3.so
b725a000-b725e000 rw-p 00000000 00:00 0
b725e000-b7262000 r-xp 00000000 ca:00 34062      /lib/libuuid.so.1.3.0
b7262000-b7263000 rw-p 00003000 ca:00 34062      /lib/libuuid.so.1.3.0
b7263000-b7266000 r-xp 00000000 ca:00 34351      /lib/libdl-2.12.so
b7266000-b7267000 r--p 00002000 ca:00 34351      /lib/libdl-2.12.so
b7267000-b7268000 rw-p 00003000 ca:00 34351      /lib/libdl-2.12.so
b7268000-b73f8000 r-xp 00000000 ca:00 34348      /lib/i686/nosegneg/libc-2.12.so
b73f8000-b73fa000 r--p 00190000 ca:00 34348      /lib/i686/nosegneg/libc-2.12.so
b73fa000-b73fb000 rw-p 00192000 ca:00 34348      /lib/i686/nosegneg/libc-2.12.so
b73fb000-b73fe000 rw-p 00000000 00:00 0
b73fe000-b7415000 r-xp 00000000 ca:00 34349      /lib/i686/nosegneg/libpthread-2.12.so
b7415000-b7416000 r--p 00016000 ca:00 34349      /lib/i686/nosegneg/libpthread-2.12.so
b7416000-b7417000 rw-p 00017000 ca:00 34349      /lib/i686/nosegneg/libpthread-2.12.so
b7417000-b741a000 rw-p 00000000 00:00 0
b741a000-b7447000 r-xp 00000000 ca:00 49674      /usr/lib/libapr-1.so.0.3.9
b7447000-b7448000 rw-p 0002c000 ca:00 49674      /usr/lib/libapr-1.so.0.3.9
b7448000-b75bb000 r-xp 00000000 ca:00 34117      /lib/libdb-4.7.so
b75bb000-b75be000 rw-p 00172000 ca:00 34117      /lib/libdb-4.7.so
b75be000-b75e4000 r-xp 00000000 ca:00 34355      /lib/libexpat.so.1.5.2
b75e4000-b75e6000 rw-p 00025000 ca:00 34355      /lib/libexpat.so.1.5.2
b75e6000-b75ed000 r-xp 00000000 ca:00 34358      /lib/libcrypt-2.12.so
b75ed000-b75ee000 r--p 00007000 ca:00 34358      /lib/libcrypt-2.12.so
b75ee000-b75ef000 rw-p 00008000 ca:00 34358      /lib/libcrypt-2.12.so
b75ef000-b7616000 rw-p 00000000 00:00 0
b7616000-b7638000 r-xp 00000000 ca:00 49763      /usr/lib/libaprutil-1.so.0.3.9
b7638000-b7639000 rw-p 00022000 ca:00 49763      /usr/lib/libaprutil-1.so.0.3.9
b7639000-b763a000 rw-p 00000000 00:00 0
b763a000-b7657000 r-xp 00000000 ca:00 34362      /lib/libselinux.so.1
b7657000-b7658000 r--p 0001c000 ca:00 34362      /lib/libselinux.so.1
b7658000-b7659000 rw-p 0001d000 ca:00 34362      /lib/libselinux.so.1
b7659000-b7688000 r-xp 00000000 ca:00 34029      /lib/libpcre.so.0.0.1
b7688000-b7689000 rw-p 0002e000 ca:00 34029      /lib/libpcre.so.0.0.1
b7689000-b76b1000 r-xp 00000000 ca:00 34354      /lib/libm-2.12.so
b76b1000-b76b2000 r--p 00027000 ca:00 34354      /lib/libm-2.12.so
b76b2000-b76b3000 rw-p 00028000 ca:00 34354      /lib/libm-2.12.so
b76b3000-b76b4000 r-xp 00000000 ca:00 200948     /usr/lib/httpd/modules/mod_env.so
b76b4000-b76b5000 r--p 00000000 ca:00 200948     /usr/lib/httpd/modules/mod_env.so
b76b5000-b76b6000 rw-p 00001000 ca:00 200948     /usr/lib/httpd/modules/mod_env.so
b76b6000-b76b8000 r-xp 00000000 ca:00 200921     /usr/lib/httpd/modules/mod_auth_basic.so
b76b8000-b76b9000 r--p 00001000 ca:00 200921     /usr/lib/httpd/modules/mod_auth_basic.so
b76b9000-b76ba000 rw-p 00002000 ca:00 200921     /usr/lib/httpd/modules/mod_auth_basic.so
b76ba000-b76bb000 rw-p 00000000 00:00 0
b76bb000-b76d9000 r-xp 00000000 ca:00 33869      /lib/ld-2.12.so
b76d9000-b76da000 r--p 0001d000 ca:00 33869      /lib/ld-2.12.so
b76da000-b76db000 rw-p 0001e000 ca:00 33869      /lib/ld-2.12.so
b76db000-b772d000 r-xp 00000000 ca:00 50480      /usr/sbin/httpd
b772d000-b772f000 rw-p 00051000 ca:00 50480      /usr/sbin/httpd
b772f000-b7732000 rw-p 00000000 00:00 0
b7c3e000-b7d8e000 rw-p 00000000 00:00 0          [heap]
b7d8e000-b7eb7000 rw-p 00000000 00:00 0          [heap]
bfb3b000-bfb5c000 rw-p 00000000 00:00 0          [stack]
f57fe000-f57ff000 r-xp 00000000 00:00 0          [vdso]
[Tue Aug 21 14:53:47 2012] [notice] seg fault or similar nasty error detected in the parent process
[Tue Aug 21 14:53:47 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Aug 21 14:53:47 2012] [notice] Digest: generating secret for digest authentication ...
[Tue Aug 21 14:53:47 2012] [notice] Digest: done
[Tue Aug 21 14:53:47 2012] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.6 configured -- resuming normal operations





/var/log/php.log
Code:
...
.....
...........
[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


Top
   
PostPosted: Wed Aug 22, 2012 3:35 am 
Offline
Senior Member

Joined: Thu Apr 12, 2012 6:26 am
Posts: 62
Location: Earth
I just found out that there is no line like
LoadModule php5_module
in my httpd.conf file..

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 noticed that I get warnings when I try to start Apache from the command line:
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


Any ideas?


Top
   
PostPosted: Wed Aug 22, 2012 11:21 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
That warning is because the edits you made to httpd.conf duplicated a setting that already existed elsewhere. It looks like things have gotten into quite a tangled mess. If I were in your position, I would wipe the server and start over. A few tips for keeping things sane:

* Install any needed packages from your distro's repositories. Don't install software via PECL, CPAN, or other outside sources. If you need a capability, check to see if there is a package from your distro that provides it.

* Don't edit config files willy-nilly. In particular, on CentOS (and many other distros), Apache uses a hierarchy of files to define virtual hosts, load modules, etc. Don't just stuff directives into httpd.conf without knowing for sure that's where they're supposed to go.

* See how others have done whatever it is you are trying to accomplish. The closer, the better. If you want to run WordPress on Apache on CentOS, don't look at howtos for Drupal on Nginx on Debian. Keep in mind that any idiot with a text editor can throw together a howto, so don't blindly trust what they have to say (yes, it can be difficult to assess the quality of instructions when you're inexperienced, but if the author can't string coherent sentences together, he probably can't provide good technical instructions either). The CentOS wiki is accurate, but the number of subjects covered is limited. Also note that documents for CentOS 5 may differ from CentOS 6.

* Following on the previous point, see if there's a more specific forum (like the CentOS forums) where you can ask your question. Not that you can't ask here, but the people there are more likely to be familiar with the particulars of your distro.


Top
   
PostPosted: Fri Aug 24, 2012 12:52 am 
Offline
Senior Member

Joined: Thu Apr 12, 2012 6:26 am
Posts: 62
Location: Earth
Thanks a million @Vance

I went over to the CentOS forum and got some help there
See: https://www.centos.org/modules/newbb/vi ... post169606

PHP is now running fine, although I never got around the issue though

I never got past this issue though..(I just tried it)

Code:
# 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


I even installed the PHP's pecl FileInfo as it contains a config.m4 file.
I added the path to the installed location..but it still didn't work when I run the command.

Since json is already packaged with my version of PHP and the application in question is now running.
I guess I can leave this alone for now.

Again, thanks for all the help.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group