473,396 Members | 2,070 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,396 software developers and data experts.

php_ext personnal

Hi all,

I would like to create a personnal dll as a php extension.

I just downloaded devC++

Can somebody help me to create a "helloworld" dll code?

I want a my_helloworld() function, compiled in a dll:
php_my.dll , with this functionnality:
<?
echo my_helloworld();
?>
returns:
<h1>hello World</h1>

###### here is C language ( or C++ ?)(? I don't know the exact syntax )
string my_helloworld(){
return "<h1>hello world</h1>";
}
#### what about "include stdio.h" ??? and main() function???
#### I would like to know exact code to compile

For yet devC++ gives me .exe, how to dll's?

I go back. cu all
Jul 17 '05 #1
7 2329
Alfred,
I would like to create a personnal dll as a php extension.

I just downloaded devC++

Can somebody help me to create a "helloworld" dll code?


Zend has the hello world as an extension example on there site. Here is
the URL:
http://www.zend.com/php/internals/ex...n-writing1.php
Jul 17 '05 #2
thanks Mike for your helpfull answer.
http://www.zend.com/php/internals/ex...n-writing1.php

According to this, u can create à dll file with notepad !!!
(And compile it with php

next ( first ) step for me:
install php in command line.

May it be possible on easyphp config?
2th step:
does
$ phpize
$ ./configure --enable-hello
$ make
function on windows platform? and How to make it work?I will perhaps
answer some questions by myself, but i stay open for discuss
Jul 17 '05 #3
Alfred,
May it be possible on easyphp config?
Probably not as that is mostly a windows based. Those instructions are
primarily *nix based.
2th step:
does
$ phpize
$ ./configure --enable-hello
$ make
function on windows platform? and How to make it work?I will perhaps
answer some questions by myself, but i stay open for discuss


No, you will need to download the php source and also have a compiler
such as bloodshed devc++. (www.bloodshed.net)

Then write your extension and build it against the php source.

Mike
Jul 17 '05 #4
I downloaded devC++ by myself,
and visual C++ according to http://www.devnewz.com/090902b.html
This tutorial explains creating some.dll with visual C++

but my php_aa2.dll returns an apache error:
unknow(): ( maybe not a PHP library )'php_aa2.dll'
???

"Mike Willbanks" <pe****@gmail.com> a écrit dans le message de news:
WE*****************@fe06.lga...
Alfred,
May it be possible on easyphp config?


Probably not as that is mostly a windows based. Those instructions are
primarily *nix based.
2th step:
does
$ phpize
$ ./configure --enable-hello
$ make
function on windows platform? and How to make it work?I will perhaps
answer some questions by myself, but i stay open for discuss


No, you will need to download the php source and also have a compiler such
as bloodshed devc++. (www.bloodshed.net)

Then write your extension and build it against the php source.

Mike

Jul 17 '05 #5
Alfred,

http://cvs.php.net/cvs.php/php-src/ext/skeleton

You might want to take a look at the skeleton to make sure your code is
working correct. I have never had an apache_error like that before.
Mostly sounds like it didn't have any of the php functions implementing
anything.

Mike
I downloaded devC++ by myself,
and visual C++ according to http://www.devnewz.com/090902b.html
This tutorial explains creating some.dll with visual C++

but my php_aa2.dll returns an apache error:
unknow(): ( maybe not a PHP library )'php_aa2.dll'
???

"Mike Willbanks" <pe****@gmail.com> a écrit dans le message de news:
WE*****************@fe06.lga...
Alfred,

May it be possible on easyphp config?


Probably not as that is mostly a windows based. Those instructions are
primarily *nix based.

2th step:
does
$ phpize
$ ./configure --enable-hello
$ make
function on windows platform? and How to make it work?I will perhaps
answer some questions by myself, but i stay open for discuss


No, you will need to download the php source and also have a compiler such
as bloodshed devc++. (www.bloodshed.net)

Then write your extension and build it against the php source.

Mike


Jul 17 '05 #6
hi mike,

I found a skeletton for win32 ( in ext/ext_skel_win32.php of php4.3.1
package)

wich didn't work because of the first 3 lines:

if (php_sapi_name() != "cli") {
echo "Please run this script using the CLI version of PHP\n";
exit;
}
echo php_sapi_name() return "apache" !!!!!

the doc said that "cli" is already installed on php 4.3.1

how can i verify and/or install a "cli" version?

Jul 17 '05 #7
Alfred,
if (php_sapi_name() != "cli") {
echo "Please run this script using the CLI version of PHP\n";
exit;
}


I do not think you will need to add in these lines. This is for when
you are making the extension only for PHP command line.

Mike
Jul 17 '05 #8

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

Similar topics

2
by: Didier Degey | last post by:
hi all here is my problem ... i'm working on a network connection project and for the application i use a multi-window system one page for the search form one page for displaying general...
14
by: pablo | last post by:
Dear NewsGroupers, I am relatively new to OOP and cannet get my head around this problem. I have two classes. Class Child extends Parent. There is no constructor for the Child class. So when I...
53
by: Paul Rubin | last post by:
I've been approached about writing a Windows app which will need a really professional looking GUI. Forget TKinter, this has to actually look good (real artists will be available to get the visual...
4
by: Brendan J Simon | last post by:
Hi, I have a Java application from a company. They also provide an API in C++ (MSW platforms only) and Java (for all platforms) for developers that want to create their own front end. I want...
5
by: StepH | last post by:
Hi, I'm new to Python. I'm working under XP, and I've alot of prob. (not with the langage itself, but with the tools): I've install Pyhton 2.4 in C:\Python24, using the .msi windows...
3
by: Gattaca | last post by:
Hello, 1. How can I create a personnal library (with my own functions) ? 2. How can I use it ? I know that in my source code I will have something like #include "mylib.h" But how to make a...
3
by: eric_caron_31 | last post by:
Here's my problem, I read numeric value and I want to display this value like this : 123 678. Value read : 123678 Value display : 123 678 I want space for separator thanks for your help
4
by: lorna.mitchell | last post by:
I hope I'm not repeating a question or missing any good resources but I really can't figure out the best way to progress with my problem. We'd like to use apache fop to generate documents in both...
6
by: msb_6 | last post by:
Currently I have a PHP extension thats all written and compiles under windows, but the PC I'm going to end up putting it on is running Ubuntu 8.04 (g++ 4.2.3). I've delved into PHP documentation...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.