473,486 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Writing a PHP extension

Hi. I have the following questions regarding writing a PHP extension.
You don't have to answer all questions. Please answer everything you
can. I'd really appreciate it.

1. What is the most common version that's used out there? If I wrote
an extension for PHP 4, would it work for PHP 5? Also, is PHP 3 very
different?

2. My extension will need to use an external C++ (not C) library.
That should be all right, right?

3. When/where/how do I specify whether or not I want my extension to
be built-in or external? I know (actually, more like, think) that it
is in config.m4 but I don't know exactly how to specify it?

4. This is probably more a C/C++ question, when/where/how do I specify
whether or not my library is to be shared/dynamic or static? Also, is
that decision relevant only for external extensions?

Thanks! That's all for now (I'm sure more will come). I'd really
appreciate any help.
Ever
Jul 17 '05 #1
4 2164
Ever Olano wrote:
1. What is the most common version that's used out there? If I wrote
an extension for PHP 4, would it work for PHP 5? Also, is PHP 3 very
different? I think it's very safe to ignore php3. It's very very rarely used out there.
You can build extensions that work for both php4 and php5. For php5, you can
add object oriented syntax to your library, which might be useful if you're
making use of eg some c++ library.
2. My extension will need to use an external C++ (not C) library.
That should be all right, right?

Yes, that's no problem. I have an url to a simple tutorial how to get
started on this:
http://bugs.tutorbuddy.com/php5cpp/php5cpp/

you might want to check out the php.pecl.dev or php.internal mailing
lists/newsgroups.

regards,
asgeir
Jul 17 '05 #2
Hi, Asgeir. I actually chanced upon your tutorial after I posted my
message. Very good. Thanks for that and for this reply! I really
appreciate it.

Ever

"Asgeir Frimannsson" <a.***********@student.qut.edu.au> wrote in message
news:40***********************@freenews.iinet.net. au...
Ever Olano wrote:
1. What is the most common version that's used out there? If I wrote
an extension for PHP 4, would it work for PHP 5? Also, is PHP 3 very
different? I think it's very safe to ignore php3. It's very very rarely used out

there. You can build extensions that work for both php4 and php5. For php5, you can add object oriented syntax to your library, which might be useful if you're making use of eg some c++ library.
2. My extension will need to use an external C++ (not C) library.
That should be all right, right?

Yes, that's no problem. I have an url to a simple tutorial how to get
started on this:
http://bugs.tutorbuddy.com/php5cpp/php5cpp/

you might want to check out the php.pecl.dev or php.internal mailing
lists/newsgroups.

regards,
asgeir

Jul 17 '05 #3
Hi, it's me again. In your tutorial, to make the extension dynamic, you
recommend using phpize, which is part of PEAR (right?). Some of our
customers may not necessarily have PEAR (right?), in which case, what is the
alternative?

Also, do third-party extensions usually supply the source code and let the
customer build it? If so, then that probably means that the customer
decides whether or not to make my extension static or dynamic. Right?

Thanks again,
Ever

"Asgeir Frimannsson" <a.***********@student.qut.edu.au> wrote in message
news:40***********************@freenews.iinet.net. au...
Ever Olano wrote:
1. What is the most common version that's used out there? If I wrote
an extension for PHP 4, would it work for PHP 5? Also, is PHP 3 very
different? I think it's very safe to ignore php3. It's very very rarely used out

there. You can build extensions that work for both php4 and php5. For php5, you can add object oriented syntax to your library, which might be useful if you're making use of eg some c++ library.
2. My extension will need to use an external C++ (not C) library.
That should be all right, right?

Yes, that's no problem. I have an url to a simple tutorial how to get
started on this:
http://bugs.tutorbuddy.com/php5cpp/php5cpp/

you might want to check out the php.pecl.dev or php.internal mailing
lists/newsgroups.

regards,
asgeir

Jul 17 '05 #4
Ever Olano wrote:
Hi, Asgeir. I actually chanced upon your tutorial after I posted my
message. Very good. Thanks for that and for this reply! I really
appreciate it.

Ever


Hi, it's not my tutorial sorry. And I haven't made an extension myself
yet :) Just fiddled with it a bit a while ago. But yes, it's a great
starter-tutorial, and i thought it would be useful for you.

regards,
asgeir
Jul 17 '05 #5

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

Similar topics

3
3067
by: Csaba Gabor | last post by:
Firefox's configuration settings (Prefs.js) can be accomplished via the interface at about:config. Q1. Is there any such setting that can be repeatedly altered via javascript (in a vanilla...
0
2111
by: robert | last post by:
Hi all, I'm having a hard time resolving a namespace issue in my wsdl. Here's an element that explains my question, with the full wsdl below: <definitions name="MaragatoService"...
4
1647
by: jackpod | last post by:
Hi, I have been trying to write an image to a database table BLOB field in MySQL but when I try to retrieve the image to display it, it shows as being empty. Are there any special considerations I...
7
5438
by: Paolo Pantaleo | last post by:
Hi, I need to write a software that allow to see the desktop and hear the microphone capture of a remote PC across a network. I need to do that for a unviresity assignement. The software must ...
5
1885
by: thewritersclub | last post by:
Hi guys! I'm new to python so please be aware that I'm probably missing the obvious. Here's my problem... Traceback (most recent call last): File "<pyshell#37>", line 1, in <module> f =...
1
1792
by: spohle | last post by:
hi, i use a lot the enumerate in my scripts and got really interested in possibly writing my own enumerate as an extension, for which i would want to extend it to be able to pass a start and...
118
4520
by: Chuck Cheeze | last post by:
This might be in the wrong group, but... Here is an example of my data: entry_id cat_id 1 20 2 25 3 30 4 25 5 35
16
1547
by: inhahe | last post by:
Can anyone give me pointers/instructions/a template for writing a Python extension in assembly (or better, HLA)?
2
1906
by: Jeff Gaines | last post by:
I am in the process of upgrading to XP 64. VS2008 is running fine but one of my apps, which adds functionality to the Explorer context menu, just won't work under XP 64. Googling resulted in my...
0
7094
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
6964
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
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7173
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...
1
6839
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
7305
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...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.