The following PHP extensions are missing: * sockets

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
systems0
Posts: 5
Joined: Wed Jun 03, 2009 1:15 pm

The following PHP extensions are missing: * sockets

Post by systems0 »

Trying to get Cacti going on my CentOS5 box.

Have running
Apache2
PHP5
MySQL5

When I access http://localhost/cacti/ I get the following message on my browser, neither apache nor mysql nor the system report any issues in the logs.

Error

The following PHP extensions are missing:
* sockets
Please install those PHP extensions and retry

Any ideas as to how to correct this problem....
Single GNU Theory
Posts: 3
Joined: Thu Oct 18, 2007 1:34 pm
Location: Chapin, SC USA

Post by Single GNU Theory »

I had to recompile PHP to get it to work. I was jumping from 0.8.6j all the way to 0.8.7d on an old RHEL 4 install in this case, but I had the same problem on a CentOS 5 box. I think PHP had previously been installed from source on the RHEL box; it's something I inherited rather than built myself.

In the ./configure step building PHP, append --enable-sockets to whatever your ./configure command line was before.

I found out what the config used was by creating a file called phpinfo.php in Apache's root directory. The contents of that file consist of:

<?php phpinfo(); ?>

Then go to the URL http://yourserver/phpinfo.php and it should tell you up at the top what the config string was.
systems0
Posts: 5
Joined: Wed Jun 03, 2009 1:15 pm

The following PHP extensions are missing: * sockets

Post by systems0 »

That worked!!!
thank you!!!
I had to append --enable-sockets at the beginning of ,.configure and then the rest of my options....

thanks again!
emyasar
Posts: 7
Joined: Thu Jun 21, 2012 8:23 am

Re: The following PHP extensions are missing: * sockets

Post by emyasar »

i could not understand what should i do?

php info shows ;

'../configure' '--prefix=/usr' '--datadir=/usr/share/php5' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--with-libdir=lib64' '--includedir=/usr/include' '--sysconfdir=/etc/php5/apache2' '--with-config-file-path=/etc/php5/apache2' '--with-config-file-scan-dir=/etc/php5/conf.d' '--enable-libxml' '--enable-session' '--with-mm' '--with-pcre-regex=/usr' '--enable-xml' '--enable-simplexml' '--enable-spl' '--enable-filter' '--disable-debug' '--enable-inline-optimization' '--disable-rpath' '--disable-static' '--enable-shared' '--program-suffix=5' '--with-pic' '--with-gnu-ld' '--with-system-tzdata=/usr/share/zoneinfo' '--with-apxs2=/usr/sbin/apxs2' '--disable-all' '--disable-cli'
Single GNU Theory
Posts: 3
Joined: Thu Oct 18, 2007 1:34 pm
Location: Chapin, SC USA

Re: The following PHP extensions are missing: * sockets

Post by Single GNU Theory »

The configure string shows what options were turned on when PHP was compiled. The PHP you're using was built without sockets. You need to recompile PHP, with the same options it had before, and add sockets while you're at it.

I don't know how familiar you are with compiling software, but generally, you download and unpack the source code, configure the options (in your case, it'll be something like "./configure --enable-sockets --prefix=/usr --datadir=/usr/share/php5..." plus everything else in the configure string you posted) , compile it, then install it.
robin713
Posts: 3
Joined: Wed Jul 18, 2012 3:49 am

Re: The following PHP extensions are missing: * sockets

Post by robin713 »

but I still get the error even I compile with --enable-sockets option. I use php -m and I can see the sockets is in.
I restart the http service ,doesn't work. I try add a line extension=sockets.so or extension=/usr/local/xxx/sockets.so
it still doesn't work.

why?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: The following PHP extensions are missing: * sockets

Post by gandalf »

Did you restart httpd, then?
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest