store | blogs | forums | twitter | facebook | wiki | downloads | support portal
Atomic Secure Linux
It is currently Thu Oct 30, 2014 6:51 pm

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: JSON support for PHP???
Unread postPosted: Mon Oct 31, 2011 11:59 am 
Offline
Forum Regular
Forum Regular

Joined: Mon Oct 31, 2011 11:47 am
Posts: 100
Location: UK
Hello,

Quite new to this, can anyone tell me how to configure JSON support for PHP on a CentOS 6 system running ART 3?

./configure is showing "--disable-json" on phpinfo() when PHP is running as an Apache module. It seems to have "--enable-json=shared" when running as Fast-CGI??

Not sure where to start or how to get round this. I've tried installing JSON through pecl but that doesn't work as it comes back with
Code:
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/json.so' - /usr/lib64/php/modules/json.so: undefined symbol: ZVAL_DELREF in Unknown on line 0
so I've uninstalled that and removed the json.ini file from /etc/php.d/.

I'm a bit stuck really and not sure where to go, seems that I'm going in circles as almost all JSON tutorials point me to install via PECL but that doesn't seem to work. I haven't recompiled PHP before and this is a live server so I'm nervous about bringing the whole thing to a grinding halt and would love some guidance.

Thank you in advance
Andy


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Tue Nov 01, 2011 8:44 am 
Offline
Forum Regular
Forum Regular

Joined: Mon Oct 31, 2011 11:47 am
Posts: 100
Location: UK
This is the error I'm getting when installing json through pecl
Code:
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/json.so' - /usr/lib64/php/modules/json.so: undefined symbol: ZVAL_DELREF in Unknown on line 0


And the only reference to this I've found is here http://forums.famillecollet.com/viewtopic.php?id=76

Any thoughts?


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Tue Nov 01, 2011 4:50 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3661
Location: Chantilly, VA
Which PHP rpm do you have installed?

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Wed Nov 02, 2011 11:44 am 
Offline
Forum Regular
Forum Regular

Joined: Mon Oct 31, 2011 11:47 am
Posts: 100
Location: UK
Hello Mike,

Code:
 rpm -qa | less | grep php
shows the following:

Code:
roadsend-php-libs-2.9.8-10.2.el6.art.x86_64
asl-php-common-5.2.17-1.el6.art.x86_64
asl-php-mysql-5.2.17-1.el6.art.x86_64
php-common-5.3.8-2.el6.art.x86_64
php-mysql-5.3.8-2.el6.art.x86_64
php-xml-5.3.8-2.el6.art.x86_64
php-pear-1.9.0-2.el6.noarch
asl-php-pdo-5.2.17-1.el6.art.x86_64
asl-php-gd-5.2.17-1.el6.art.x86_64
php-ioncube-loader-4.0.10-1.el6.art.x86_64
php-pdo-5.3.8-2.el6.art.x86_64
php-gd-5.3.8-2.el6.art.x86_64
php-mbstring-5.3.8-2.el6.art.x86_64
php-zend-guard-loader-5.5.0-3.el6.art.x86_64
asl-php-5.2.17-1.el6.art.x86_64
php-5.3.8-2.el6.art.x86_64
php-imap-5.3.8-2.el6.art.x86_64
php-soap-5.3.8-2.el6.art.x86_64
php-eaccelerator-5.3.8_0.9.6.1-1.el6.art.x86_64
asl-php-cli-5.2.17-1.el6.art.x86_64
psa-php5-configurator-1.6.1-rhel6.build1012110525.15.x86_64
php-cli-5.3.8-2.el6.art.x86_64
php-devel-5.3.8-2.el6.art.x86_64
php-mcrypt-5.3.8-2.el6.art.x86_64

Your help is very much appreciated.

Many thanks


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Wed Nov 02, 2011 11:54 am 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3661
Location: Chantilly, VA
OK, thank you. Can you confirm that the .so is from those rpms?

And if so, have you tried downloading the src rpm for 5.3.8 from the atomic repo and building it for your needs from there?

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Wed Nov 02, 2011 2:26 pm 
Offline
Forum Regular
Forum Regular

Joined: Mon Oct 31, 2011 11:47 am
Posts: 100
Location: UK
Hello Michael,

This is what I did:

Code:
# yum update php
# yum install php-pear
# yum install gcc
# pecl install json
# service httpd restart


Not quite sure where the .so is coming from in this case.

I haven't tried rebuilding the rpm for 5.3.8; I wouldn't know where to start as I haven't rebuilt from an rpm before and I wouldn't want to break anything.

Can you tell me then if the 5.3.8 coming from ASL has --disable-json configured by default? If so could that decision be re-considered given that JSON is part of PHP 5.2 and that many open source platforms require encrypt_json and decrypt_json e.g. wordpress? Is it a security risk to have it enabled by default?

Thanks


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Wed Nov 02, 2011 3:04 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3661
Location: Chantilly, VA
json.so is already included in 5.3.8, you may have overwritten it with the pecl install.

[root@asl-modsec-test ~]# rpm -qf /usr/lib64/php/modules/json.so
php-common-5.3.8-2.el5.art

What happens if you do a clean install of PHP?

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Wed Nov 02, 2011 3:28 pm 
Offline
Forum Regular
Forum Regular

Joined: Mon Oct 31, 2011 11:47 am
Posts: 100
Location: UK
Hello Mike,

I get the same:

Quote:
# rpm -qf /usr/lib64/php/modules/json.so
php-common-5.3.8-2.el6.art.x86_64


How do I do a clean install or remove any instances of the pecl installation? I've done a pecl uninstall.

There isn't a file located at /usr/lib64/php/modules/json.so but I can see a similar looking file at /var/asl/usr/lib64/php/modules/json.so should I copy /var/asl/usr/lib64/php/modules/json.so to /usr/lib64/php/modules/json.so?

Alternatively can you tell me how I do a clean install of PHP? Quite new to this (sorry).

Many thanks


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Wed Nov 02, 2011 3:31 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3661
Location: Chantilly, VA
Sure, no problem. So the easy way is to just do a "yum remove php" and then do a "yum install php".

Quote:
/var/asl/usr/lib64/php/modules/json.so should I copy /var/asl/usr/lib64/php/modules/json.so to /usr/lib64/php/modules/json.so?


No dont do that. Thats for the ASL GUI, its got its own PHP install that doesnt have anything to do with the OS. You dont want to use those shared objects.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Wed Nov 02, 2011 3:36 pm 
Offline
Forum Regular
Forum Regular

Joined: Mon Oct 31, 2011 11:47 am
Posts: 100
Location: UK
Many thanks Mike,

Sorry to be pedantic, but it's a live server and I've been thrown in at the deep end a little. We're looking for a server admin to assist but right now it's just me.

If I do a "yum remove php" and "yum install php" and if the yum repositories are unchanged from the ones Plesk and ASL what's the possibility/likelyhood this might break Plesk or the webserver? I realise you can't give me an definite answer and I won't hold you to it but is this 99% likely to work without any problems or is it more like 50-50?

Just a little paranoid and I'm stuck between a rock and a hard place with a requirement to get JSON working and the potential horror that the server may roll over and die.

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Wed Nov 02, 2011 4:42 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3661
Location: Chantilly, VA
Well, on a live server thats going to disable PHP during the reinstall (which will break any PHP apps temporarily). I had to guess, Plesk likely has PHP as a dependency so uninstalling PHP may also try to uninstall some of Plesk.

One way to find out is to run the command, and when asked if you want to continue say no and post the output here. If its just PHP thats being removed, then the impact would only be (temporarily) on PHP applications.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Wed Nov 02, 2011 5:16 pm 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Sat Aug 20, 2005 9:30 am
Posts: 2812
Location: The Netherlands
I suggest downloading the php-common package (which contains the json extension) and reinstalling that, which should overwrite json.so with the good file.

Something like this:

Code:
yumdownloader php-common
rpm -Uvh --force php-common*.rpm
service httpd reload
rm php-common*.rpm


(Hey, my signature mentions a company that can manage servers for you!)

_________________
Lemonbit Internet Dedicated Server Management


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Wed Nov 02, 2011 5:50 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3661
Location: Chantilly, VA
Yep, that will do as well.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Thu Nov 03, 2011 2:48 pm 
Offline
Forum Regular
Forum Regular

Joined: Mon Oct 31, 2011 11:47 am
Posts: 100
Location: UK
Hello both,

I had to install yum-utils to get yumdownloader to work. It downloads the following files:

Quote:
php-common-5.3.8-2.el6.art.i686.rpm
php-common-5.3.8-2.el6.art.x86_64.rpm


Are these both to be run using
Quote:
rpm -Uvh --force php-common*.rpm
or should I just be running
Quote:
rpm -Uvh --force php-common-5.3.8-2.el6.art.x86_64.rpm


Thanks again for your help, I really really appreciate it.


Top
 Profile  
 
 Post subject: Re: JSON support for PHP???
Unread postPosted: Thu Nov 03, 2011 2:50 pm 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Sat Aug 20, 2005 9:30 am
Posts: 2812
Location: The Netherlands
You probably only need the 64-bit package. I guess you also have only the 64-bit versions installed of the other PHP packages.

_________________
Lemonbit Internet Dedicated Server Management


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest


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
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group