CHRamesh Posted June 1, 2013 Share Posted June 1, 2013 How to read .so file in php can any one help me Thanks Quote Link to comment Share on other sites More sharing options...
requinix Posted June 1, 2013 Share Posted June 1, 2013 Read how? Do you know what you're talking about? Quote Link to comment Share on other sites More sharing options...
xenLiam Posted June 1, 2013 Share Posted June 1, 2013 Read as in put it in php.ini? Put extension=ext.so in php.ini (replace ext.so with the extension you want to include and make sure it exists in your extension directory). Quote Link to comment Share on other sites More sharing options...
cpd Posted June 1, 2013 Share Posted June 1, 2013 This is simple file/directory testing stuff, i.e. you can use file_exists($file) and if it does, overwrite the .ini setting; be it temporarily or permanently. Quote Link to comment Share on other sites More sharing options...
CHRamesh Posted June 3, 2013 Author Share Posted June 3, 2013 Read how? Do you know what you're talking about? I know what i am asking. I am asking how to how to execute the 'libpdu1.so' file in php Quote Link to comment Share on other sites More sharing options...
Jessica Posted June 3, 2013 Share Posted June 3, 2013 Executing a script is not the same thing as reading a file. It doesn't matter if you know what you're asking if the people you're asking don't know what you mean. I had no idea what a .so file was, but one quick Google search gave me the explanation of what it was, and adding the term "PHP" to that same search gave me the exact code to load a .so file. We are not google. We don't appreciate people who don't do basic research, and waste our time with poor communication. Take responsibility for your part in getting help, and you'll actually get some. Quote Link to comment Share on other sites More sharing options...
trq Posted June 3, 2013 Share Posted June 3, 2013 So files cannot be executed directly by PHP, they are shared objects, made for C. PHP extensions are packaged into shared objects, is what you really want to do to load an extension? Quote Link to comment Share on other sites More sharing options...
requinix Posted June 3, 2013 Share Posted June 3, 2013 I know what i am asking. I am asking how to how to execute the 'libpdu1.so' file in php This? You'd have to write a PHP extension for it - PHP code alone won't be enough. Quote Link to comment Share on other sites More sharing options...
CHRamesh Posted June 4, 2013 Author Share Posted June 4, 2013 (edited) So files cannot be executed directly by PHP, they are shared objects, made for C. PHP extensions are packaged into shared objects, is what you really want to do to load an extension? I am using php 5.3.10 and i check the dl() function but it is not working. Now what i can do.can you help me how to load .so file in php Edited June 4, 2013 by CHRamesh Quote Link to comment Share on other sites More sharing options...
kicken Posted June 4, 2013 Share Posted June 4, 2013 You can't just load any .so file into PHP and have it work. The only .so files you can load into PHP are PHP Extensions. Given what you've written so far, you don't appear to be trying to load an extension, so you cannot load the file into PHP. Quote Link to comment Share on other sites More sharing options...
CHRamesh Posted June 4, 2013 Author Share Posted June 4, 2013 This? You'd have to write a PHP extension for it - PHP code alone won't be enough. Hi, I write some code in c and i use file function to open the .so file it will work fine . But how to load that file in php. I am using php 5.3.10.In that dl() function is not working.What i can do.just tell me how to write php code. Quote Link to comment Share on other sites More sharing options...
requinix Posted June 4, 2013 Share Posted June 4, 2013 You have to write an extension to PHP for it. Using C/C++ code. PHP code alone is not enough. Quote Link to comment 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.