Topic: PHP extensions
started by: pst
Posted by pst on Nov. 07 2005,03:33First of all thanks for an excellent distro and a nice set of DSL extensions!
Now to my question...I need to use the socket functions in php. From what I can understand the php-4-monkey doesn't include any extensions.
So does that mean I have to build PHP from source and make my own DSL extension or can I "steal" the php extension (php_sockets.so) from somewhere and copy it?
Posted by pst on Nov. 28 2005,13:32To get extensions like socket functions working in php you need the correct entry in php.ini as well as the .so file.
I don't exactly know hot to roll my own dsl file even if I suspects it's only an archive file. So I did the quick and dirty version:
1. Find a sockets.so file.
I found a sockets.so file here:
< http://www.hardhathosting.com/community/forums/showthread.php?t=153 >
but I guess any file from a linux target system with a reasonalby close version number would have worked. The php version in php-4-monkey is 4.3.7
The file could be placed anywhere. I placed it in a new directory: /opt/php/ext
2. Make a php.ini file.
For php to find the sockets extension file or actually make any changes to the php config you need the php.ini file which isn't included in the php-4-monkey myDSL extension.
I placed the file in:
You can find exemples on the net or steal it somewhere else. I just made a minimal file which looks like this:
3. Backup the files.
Add /opt/php/ext and /opt/php/lib/php.ini to your .filetool.lst file in /home/dsl.
This makes sure your files are gets saved (unless you have a full harddisk install of course).
Posted by pst on Nov. 28 2005,13:45BTW, To check which options and php extensions you have make a php file with phpinfo().
It should now have a section like this:
Sockets Support enabled