# Extending PHP with C++ (Newbie Question)

- Thread: https://externals.io/message/41921
- Original archive: https://news-web.php.net/php.internals/41921
- Started by Chris Jiang on 2008-11-15T15:11:40+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #41921 — Chris Jiang — 2008-11-15T15:11:40+00:00

URL: https://externals.io/message/41921#41921

Hi all, it's my first time posting in this mailing list.

I've been trying to make a PHP extension for my project, and would 
really like to use C++ instead of C to write the code. I've been 
searching for some tutoral or manual for some time already, but not so 
lucky fining anything useful for newbies like myself.

Yes, I've searched quite carefully on the search engine and the achive 
of this mailing list. End up finding a really old (posted in 2004) 
thread by someone signed as 'J', directing to a link sort of like 
http://tutorbuddy.com/software/phpcpp. I guess this might be what I 
need, but the article seems already out of date. I've found a translated 
version of this article, and made a testing extension following the 
instructions, however it didn't work.

The article was written for PHP 4.2.X, and the sample code is missing 
(the link is broken). I'm currently working with PHP 5.2.5. Is it 
because PHP 5.2.5 is really different with 4.X? Or the document was not 
properly translated?

Can someone be so kind to point me an URL of this original article?

Thank you all!

---

## #41923 — Paul Biggar — 2008-11-15T16:24:23+00:00

URL: https://externals.io/message/41921#41923 · In reply to: #41921

Hi Chris,


> I've been trying to make a PHP extension for my project, and would really
> like to use C++ instead of C to write the code. I've been searching for some
> tutoral or manual for some time already, but not so lucky fining anything
> useful for newbies like myself.


It looks like http://developers.facebook.com/phpembed/ will give you
what you're looking for.

Paul


-- 
Paul Biggar
paul.biggar@gmail.com

---

## #41925 — Pierre Joye — 2008-11-15T16:42:08+00:00

URL: https://externals.io/message/41921#41925 · In reply to: #41921

hi,

Take a look in pecl/rar for an example of a c++ based extension (or
some other pecl extensions)


> Hi all, it's my first time posting in this mailing list.
>
> I've been trying to make a PHP extension for my project, and would really
> like to use C++ instead of C to write the code. I've been searching for some
> tutoral or manual for some time already, but not so lucky fining anything
> useful for newbies like myself.
>
> Yes, I've searched quite carefully on the search engine and the achive of
> this mailing list. End up finding a really old (posted in 2004) thread by
> someone signed as 'J', directing to a link sort of like
> http://tutorbuddy.com/software/phpcpp. I guess this might be what I need,
> but the article seems already out of date. I've found a translated version
> of this article, and made a testing extension following the instructions,
> however it didn't work.
>
> The article was written for PHP 4.2.X, and the sample code is missing (the
> link is broken). I'm currently working with PHP 5.2.5. Is it because PHP
> 5.2.5 is really different with 4.X? Or the document was not properly
> translated?
>
> Can someone be so kind to point me an URL of this original article?
>
> Thank you all!
>
> --
> 
> 
>
>



-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #41935 — Chris Jiang — 2008-11-16T06:00:18+00:00

URL: https://externals.io/message/41921#41935 · In reply to: #41925

Thank you all for the reply. I guess I'll take a look at those document 
and samples, start playing around with it a bit. :D

---

## #41937 — Moriyoshi Koizumi — 2008-11-16T08:27:19+00:00

URL: https://externals.io/message/41921#41937 · In reply to: #41921

Hey,

Don't forget to have a look at Boost.PHP :)

http://github.com/moriyoshi/boost.php/wikis

Moriyoshi


> Hi all, it's my first time posting in this mailing list.
>
> I've been trying to make a PHP extension for my project, and would really
> like to use C++ instead of C to write the code. I've been searching for some
> tutoral or manual for some time already, but not so lucky fining anything
> useful for newbies like myself.
>
> Yes, I've searched quite carefully on the search engine and the achive of
> this mailing list. End up finding a really old (posted in 2004) thread by
> someone signed as 'J', directing to a link sort of like
> http://tutorbuddy.com/software/phpcpp. I guess this might be what I need,
> but the article seems already out of date. I've found a translated version
> of this article, and made a testing extension following the instructions,
> however it didn't work.
>
> The article was written for PHP 4.2.X, and the sample code is missing (the
> link is broken). I'm currently working with PHP 5.2.5. Is it because PHP
> 5.2.5 is really different with 4.X? Or the document was not properly
> translated?
>
> Can someone be so kind to point me an URL of this original article?
>
> Thank you all!

---

## #41940 — Chris Jiang — 2008-11-16T13:05:42+00:00

URL: https://externals.io/message/41921#41940 · In reply to: #41937

Hey! That totally rocks! Thank you very much for this info. I'm really 
having nightmare with C in Zend Style during the entire weekend. A 
function works fine in pure GCC compiling mode but returns weird result 
in Zend Style.


Moriyoshi Koizumi wrote:
> Hey,
> 
> Don't forget to have a look at Boost.PHP :)
> 
> http://github.com/moriyoshi/boost.php/wikis
> 
> Moriyoshi
> 
> 
> > […]
