473,395 Members | 1,383 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

calling a native library

I am developing a PHP site to run on a Linux server. I need to access a
proprietary algorithm that is compiled into a C shared object.

I have been looking for the best way to do this and noticed that I can
write a Zend engine extension to allow me to do this but I was wondering
if there was a more simple way.

Is a PHP library that allows me to load and the .so file without having
to write my own wrapper (sort of like a dlopen() or LoadLibrary() for
PHP)? I have looked at the PHP manual on PHP.net but couldn't see anything.

Are there any other alternatives or is the Zend extension the best/only way.

I am more familiar with C & C++ than PHP so forgive me if this is a
stupid question.

Thanks very much in advance
Andy
Feb 2 '06 #1
1 2331
us**@domain.invalid wrote:
I am developing a PHP site to run on a Linux server. I need to access a
proprietary algorithm that is compiled into a C shared object.

I have been looking for the best way to do this and noticed that I can
write a Zend engine extension to allow me to do this but I was wondering
if there was a more simple way.

Is a PHP library that allows me to load and the .so file without having
to write my own wrapper (sort of like a dlopen() or LoadLibrary() for
PHP)? I have looked at the PHP manual on PHP.net but couldn't see
anything.

Are there any other alternatives or is the Zend extension the best/only
way.


I'm not aware of anything like you suggest. Wite your own main(argc, argv)
function to call it then use one of the program execution fns in PHP? I
guess by the time you created a daemon wrapper around the library and wrote
the PHP end, you'd probably be as quick building it into a PHP extension.

C.
Feb 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: brian | last post by:
Hi, I've got a situation where I have a bunch of legacy code accessing a database through an archive. (Not a shared object). I've written an interface to this legacy code with C & Java using...
4
by: David Kantowitz | last post by:
I am trying to wrap a native-C++ DLL in managed C++, to use in a .NET project. The native code is compiled into a DLL, and I have created a .def file that exports the mangled names of the...
17
by: Patrick | last post by:
I am almost certain that I could use HTTP Post/Get to submit XML Web Service call (over SSL as well, if using Version 3 of MSXML2) from an ASP Application? However, would I only be able to call...
6
by: jacob ya | last post by:
Hi, I'm working on a project that requires us to call some mathematical functions that are in a Fortran dll. I'm trying to call the function using P/Invoke, but I keep getting a null reference...
2
by: Jacob Cohen | last post by:
Under VC7.1, I am trying to wrap a native-C++ DLL that contains C++ objects in a Managed-C++ class library for use in a C# project. I created and compiled the native DLL under VC7.1 as a Win32...
1
by: Paul Brun | last post by:
Hi guys, I get the following error during runtime: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at SXInit(Int32 ) The SXInit...
4
by: Tim Menninger | last post by:
Just started working on this and have not found any real good resources out there. We have a lot of native C++ Dll code that we use for our app. We want to share the code so that C# ASP.net code...
1
by: Bern McCarty | last post by:
What do you make of this? I cannot tell for sure but it almost seems as the the transition thunk to get back from the native bool method to the managed caller is looking at eax and, if any bit is...
1
by: H.B. | last post by:
Hi, I need to make a function that can display data on my Managed C++ app and be called by an unmanaged C++ DLL. Something like : void Form1::Form1_Load(System::Object * sender,...
2
by: Haroon_Saeed | last post by:
Hey, I wrote a managed c++ class library in viusal studio 2005. This managed c++ dll calls native C++ methods of an SDK. When I referenced this managed c++ library in a console applciation...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.