By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,967 Members | 1,687 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,967 IT Pros & Developers. It's quick & easy.

Problems with External Php Extensions

P: n/a
I am trying to build a simple PHP Extension which simply returns a
string object.

I have followed the tutorial found on http://devzone.zend.com/node/view/id/1021
up until the deployment stage. Instead of deploying the compiled
module in the PHP Ini directory, I copied it in the same folder where
the test.php page is. Then I am loading the module using the dl()
method.

By using the extension_loaded() method I am making sure that the
extension is loaded successfully, however when I try to execute the
GetMessage method found in the extension, the php compiler just
crashes. ie. it stops compiling and does not issue any form of error
message.

I even tried to capture any exception thrown by calling the
GetMessage() function from within a Try Catch block, however no
exception is thrown, the compiler just crashes, or so it seems.

Any idea what I might be doing incorrectly? Since the Extension
compiles successfully and the module files are created without error,
can I consider that step done? Or can the problem reside in the
original source?

Any help would be greatly appreciated.

Thanks and Regards,
Luke
Oct 3 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Luke wrote:
I am trying to build a simple PHP Extension which simply returns a
string object.

I have followed the tutorial found on http://devzone.zend.com/node/view/id/1021
up until the deployment stage. Instead of deploying the compiled
module in the PHP Ini directory, I copied it in the same folder where
the test.php page is. Then I am loading the module using the dl()
method.

By using the extension_loaded() method I am making sure that the
extension is loaded successfully, however when I try to execute the
GetMessage method found in the extension, the php compiler just
crashes. ie. it stops compiling and does not issue any form of error
message.

I even tried to capture any exception thrown by calling the
GetMessage() function from within a Try Catch block, however no
exception is thrown, the compiler just crashes, or so it seems.

Any idea what I might be doing incorrectly? Since the Extension
compiles successfully and the module files are created without error,
can I consider that step done? Or can the problem reside in the
original source?

Any help would be greatly appreciated.

Thanks and Regards,
Luke
Compilers only catch syntax errors. They won't catch things like access
violations or any of a million other runtime errors you might have.

You need to determine exactly where your problem lies. My bet is on
your extension.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Oct 3 '08 #2

P: n/a
NC
On Oct 3, 4:23 am, Luke <luwk.ro...@gmail.comwrote:
>
I am trying to build a simple PHP Extension which simply
returns a string object.
There is no such thing as a "string object" in PHP. In PHP, strings
are scalar...
I have followed the tutorial found onhttp://devzone.zend.com/node/view/id/1021
up until the deployment stage. Instead of deploying the compiled
module in the PHP Ini directory, I copied it in the same folder where
the test.php page is. Then I am loading the module using the dl()
method.
dl() is not a method (meaning, it doesn't belong to any object), it is
a function.

Have you read the documentation for dl()? Are you sure that it is
allowed on your system to load an extension from the directory where
your scripts are located?

Cheers,
NC
Oct 5 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.