I'm using php4Delphi 6.2.2 with BDS 2006 and PHP 5.2.0. Everything compiles fine and seems to be working, but I just don't receive any result after executing a piece of PHP code. The result string is empty.
Any ideas of what I'm doing wrong?
Cesar Cepeda.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems that the problem arises only when calling TpsvCustomPHP.RunCode and not when calling TpsvCustomPHP.Execute(File). The pipe is opened correctly and the code is written to it, I don't know if there is something wrong with the zend_file_handle initializacion when using the virtual file created by RunCode.
I hope this helps to pinpoint the problem.
Thanks.
Cesar Cepeda
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are few things can be wrong.
1. Check you php.ini file:
short_open_tag = On
By default it's "off"
2. How long is your script?
If you want to execute very long script, you have to increase the pipe buffer size:
in CreateVirtualFile function at the following line:
if pipe(@_handles, Length(ACode) + 4096, 0) = -1 then
replace 4096 by bigger number
3. Check UseDelimiters = true or add <?..?> delimiters to your code manually.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm using php4Delphi 6.2.2 with BDS 2006 and PHP 5.2.0. Everything compiles fine and seems to be working, but I just don't receive any result after executing a piece of PHP code. The result string is empty.
Any ideas of what I'm doing wrong?
Cesar Cepeda.
It seems that the problem arises only when calling TpsvCustomPHP.RunCode and not when calling TpsvCustomPHP.Execute(File). The pipe is opened correctly and the code is written to it, I don't know if there is something wrong with the zend_file_handle initializacion when using the virtual file created by RunCode.
I hope this helps to pinpoint the problem.
Thanks.
Cesar Cepeda
There are few things can be wrong.
1. Check you php.ini file:
short_open_tag = On
By default it's "off"
2. How long is your script?
If you want to execute very long script, you have to increase the pipe buffer size:
in CreateVirtualFile function at the following line:
if pipe(@_handles, Length(ACode) + 4096, 0) = -1 then
replace 4096 by bigger number
3. Check UseDelimiters = true or add <?..?> delimiters to your code manually.
Check also this message:
http://sourceforge.net/forum/message.php?msg_id=4258966