Forum Moderators: coopster

Message Too Old, No Replies

PHP Extensions

         

EliteGhost

3:30 am on Mar 20, 2009 (gmt 0)

10+ Year Member



Forgive me This is way out of my feild.
I am trying to install a php extension that uses C++ libraries to build a .so file that I want to load into my ftp server for goodies to be added into my website.

My server is Linux based. The first thing I need help to do is to use a "makefile" to build the .so file. What program do I use to accomplish this, where can i get it?

Once I get this .so file, I need to upload it into my php extensions directory. Which according to my hosting provider, I cannot access because it is "shared" with everyone. They let me change my php.ini. With that I am capable of changing my php extensions directory. I can now load anything into the php extensions directory i have defined.

Because I am completely oblivious to php extensions, I almost know i am doing things that will have horrible consequences, thankfully I backed up my files. Can someone please help me? Tell me if Im going about this propperly, shed some light on my situation.

Thanks

[edited by: coopster at 12:53 pm (utc) on Mar. 20, 2009]
[edit reason] removed hosting specifics [/edit]

eeek

5:01 am on Mar 21, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The first thing I need help to do is to use a "makefile" to build the .so file. What program do I use to accomplish this, where can i get it?

There's no makefile with the extension code? Is there a configure script? What about an INSTALL document?

Once I get this .so file, I need to upload it into my php extensions directory. Which according to my hosting provider, I cannot access because it is "shared" with everyone.

You should be able to put the .so file anywhere and use dl() to load it at run time.

EliteGhost

10:08 am on Mar 21, 2009 (gmt 0)

10+ Year Member




There's no makefile with the extension code? Is there a configure script? What about an INSTALL document?

There is a "makefile". There is a config script. The Readme.txt? Yes, there is one.


You should be able to put the .so file anywhere and use dl() to load it at run time.

Yes, I should be able too. Your instructions almost exactly match the instructions that came with this package, lol and you make it sound so simple.

Can you please help me understand how to use this makefile. When i double click it, it asks me what to run it with. I dont know what to do with it, and how to get my .so file.

Once i get the .so file uploaded is " dl() " a function i call in php? and that calls the extension when i need it?

Thanks,

EliteGhost

9:08 pm on Mar 22, 2009 (gmt 0)

10+ Year Member



okay, so heres where im at, My wehbosting service is Linux, My computer is Windows, The library that i downloaded [repasm.net...] comes in .dll's for php4 and php5 and the sources if you need to build a .so. I took the php4 and php5 and put them on my server. I put them in the same folder that my page is calling the library

i used

 dl(repasm.dll); [code]
and then
[code] $info = php_bw_load_replay($_FILES["file"]);
if($info->ErrorCode != 0)
die("Could not load the replay ! Message : " . $info->ErrorString);
echo "Game played on " . $info->Map->Name;
echo "<br>Duration : " . $info->GameLength;
echo "<br>Players info : <br>";
foreach($info->Players as $player)
echo $player->Name . " : " . $player->RaceName . ", " . $player->APM . "APM.<br>";

to test it.

I get an error obviously.

Warning: dl(): Unable to load dynamic library '/hsphere/shared/apache/libexec/php4ext/repasmdll' - /hsphere/shared/apache/libexec/php4ext/repasmdll: cannot open shared object file: No such file or directory

I think this is because it does not know where my extension folder is. please help!

eeek

11:13 pm on Mar 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



is " dl() " a function i call in php?

Yes, and the php manual would have answered that question much faster than asking here.

My wehbosting service is Linux

Good.

My computer is Windows

Bummer

.dll's for php4 and php5

Which will be of no use on the Linux server.

I took the php4 and php5 and put them on my server.

You put windows dll files on a Linux server? That won't work.

You need to build the .so on the Linux server.