DWilliams Posted May 25, 2010 Share Posted May 25, 2010 I moved one of my scripts over to a new machine. It requires a special compilation of PHP with socket support and a couple other things. I had it working fine on the old machine, but this one appears to be having troubles for some reason. I compiled and installed PHP with the required extensions. When I run my script, I get the following error: PHP Fatal error: Call to undefined function socket_create() in /home/danny/projects/PHPChatServ/ChatServ.php on line 379 Here is the "Configure Command" section of my phpinfo() showing that it was indeed compiled with the --enable-sockets option: Configure Command => './configure' '--srcdir=../php-5.3.2' '--prefix=/usr' '--sysconfdir=/etc/php' '--with-layout=GNU' '--with-config-file-path=/etc/php' '--with-config-file-scan-dir=/etc/php/conf.d' '--enable-inline-optimization' '--disable-debug' '--disable-rpath' '--disable-static' '--enable-shared' '--mandir=/usr/share/man' '--without-pear' '--disable-cgi' '--with-readline' '--enable-pcntl' '--enable-bcmath=shared' '--enable-calendar=shared' '--enable-sockets' '--enable-pcntl' '--enable-dba=shared' '--enable-exif=shared' '--enable-ftp=shared' '--enable-gd-native-ttf' '--enable-intl=shared' '--enable-json=shared' '--enable-mbregex' '--enable-mbstring' '--enable-pdo=shared' '--enable-phar=shared' '--enable-posix=shared' '--enable-session' '--enable-shmop=shared' '--enable-soap=shared' '--enable-sockets=shared' '--enable-sqlite-utf8' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--enable-xml' '--enable-zip=shared' '--with-bz2=shared' '--with-curl=shared' '--with-db4=shared' '--with-enchant=shared,/usr' '--with-freetype-dir=shared,/usr' '--with-gd=shared,/usr' '--with-gdbm=shared' '--with-gettext=shared' '--with-gmp=shared' '--with-iconv=shared' '--with-icu-dir=/usr' '--with-imap-ssl=shared' '--with-imap=shared' '--with-jpeg-dir=shared,/usr' '--with-ldap=shared' '--with-ldap-sasl' '--with-mcrypt=shared' '--with-mhash' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-mysql=shared,mysqlnd' '--with-mysqli=shared,mysqlnd' '--with-openssl=shared' '--with-pcre-regex=/usr' '--with-pdo-mysql=shared,mysqlnd' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-pgsql=shared' '--with-pdo-sqlite=shared,/usr' '--with-pgsql=shared' '--with-png-dir=shared,/usr' '--with-pspell=shared' '--with-regex=php' '--with-snmp=shared' '--with-sqlite3=shared,/usr' '--with-sqlite=shared' '--with-tidy=shared' '--with-unixODBC=shared,/usr' '--with-xmlrpc=shared' '--with-xsl=shared' '--with-zlib' '--without-db2' '--without-db3' What gives? Quote Link to comment https://forums.phpfreaks.com/topic/202902-socket_create-generating-error-but-php-was-compiled-with-socket-support/ Share on other sites More sharing options...
premiso Posted May 26, 2010 Share Posted May 26, 2010 http://us2.php.net/manual/en/sockets.installation.php Check out the installation document. You need to also enable the extension in the php.ini file. Quote Link to comment https://forums.phpfreaks.com/topic/202902-socket_create-generating-error-but-php-was-compiled-with-socket-support/#findComment-1063328 Share on other sites More sharing options...
DWilliams Posted May 26, 2010 Author Share Posted May 26, 2010 http://us2.php.net/manual/en/sockets.installation.php Check out the installation document. You need to also enable the extension in the php.ini file. That's strange, I don't remember having to do that before. Oh well. The instructions in that link were for Windows but the procedure for Linux is similar. It works now, thanks Quote Link to comment https://forums.phpfreaks.com/topic/202902-socket_create-generating-error-but-php-was-compiled-with-socket-support/#findComment-1063337 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.