logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in  RSS Apache Lounge  


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.


Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: Win32Service extension for PHP 5.4.1 compiling errors
Author
zx9



Joined: 18 Mar 2009
Posts: 33
Location: uruguay

PostPosted: Sun 29 Apr '12 0:31    Post subject: Win32Service extension for PHP 5.4.1 compiling errors Reply with quote

I tried to compile this extension for PHP 5.4.1 NTS VC9 in visual studio 2008 but it gives me errors and errors. I tried several ways but there is no case, I can not compile. My knowledge is very basic. I need this extension because I have to stop service in windows 7 64, run a php script with command line and then resume service. I have this for PHP 5.3.11 and run ok. but I need this for new PHP 5.4.1 . Someone could give me a hand? Someone could compile the extension? Thanks

Quote:
Guide:
Josh 24-Aug-2010 11:17
The Win32Service extension for PHP 5.3 can be found at http://downloads.php.net/pierre/

2011-05-19 RQuadling : The version that is available on Pierre's site is an old version. At the moment, the only way to get this extension that matches the current documentation is to build your own.

http://svn.php.net/viewvc/pecl/win32service/

http://pecl.php.net/package/win32service



Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2880
Location: Hilversum, NL, EU

PostPosted: Sun 29 Apr '12 13:14    Post subject: Reply with quote

What errors do you have ?

I shall try to build.

Steffen
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 633

PostPosted: Sun 29 Apr '12 16:45    Post subject: Reply with quote

Was some puzzling, but was able to build the ts and nts version for PHP 5.4.

Tested it, wow.. did not know this goody.

In a moment I shall announce it.

Thanks for the pointer.


Steffen
Back to top
zx9



Joined: 18 Mar 2009
Posts: 33
Location: uruguay

PostPosted: Mon 30 Apr '12 5:31    Post subject: error again Reply with quote

Steffen wrote:
What errors do you have ?
I shall try to build.
Steffen


I´m very beginner in compiling, is my second chance and I abandoned it.
I suspect I have some bad in "Solution -> Properties" setup on linking for libraries and others stuff.
I dont know how start in Headers and Codes, where file.c and file.h part goes . I need ultra dummy tutorial for compiling extension for php in VisualStudio 2008, for TS and NTS.

---- Off toopic
It´s a good occasion to make this Tutorial for all, but COMPLETE with alot of examples,
because all tutorial in web are incomplete , or think that in the other side the begginer know the rest of missing in examples or missing in Setup for VisualStudio or other compilers.
The tutorial does have to do ,it the way they understand a fool, with many examples and complete for a kid in kindergarten. This is the way of doing things, for everyone and we all learn.
--------------

Steffen: compiled extension NTS php_win32service.dll have error, apache2.4.2 start
but in phpinfo.php (to see loaded extension) see:
500
"Internal Server Error ,The server encountered an internal error or misconfiguration and was unable to complete your request."

Some is bad, I am very grateful that you can make this extension for php 5.4.1 nts
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2880
Location: Hilversum, NL, EU

PostPosted: Mon 30 Apr '12 10:29    Post subject: Reply with quote

Look in the php.log for the cause.

Be aware the Win32Service extension is only available when using the CLI SAPI (command line).
When you load it as extension when running as module or fast cgi then PHP does not start.


Steffen
Back to top
zx9



Joined: 18 Mar 2009
Posts: 33
Location: uruguay

PostPosted: Mon 30 Apr '12 11:40    Post subject: Still error Reply with quote

error.log on //127.0.0.1/php-info.php

[Mon Apr 30 06:33:02.924545 2012] [auth_digest:notice] [pid 2884:tid 304] AH01757: generating secret for digest authentication ...
[Mon Apr 30 06:33:02.927545 2012] [mpm_winnt:notice] [pid 2884:tid 304] AH00455: Apache/2.4.2 (Win64) mod_fcgid/2.3.7 configured -- resuming normal operations
[Mon Apr 30 06:33:02.927545 2012] [mpm_winnt:notice] [pid 2884:tid 304] AH00456: Server built: Apr 20 2012 15:32:06
[Mon Apr 30 06:33:02.927545 2012] [core:notice] [pid 2884:tid 304] AH00094: Command line: 'F:\\xampp\\Apache2.4.2\\bin\\httpd.exe -d F:/xampp/Apache2.4.2'
[Mon Apr 30 06:33:02.927545 2012] [mpm_winnt:notice] [pid 2884:tid 304] AH00418: Parent: Created child process 3472
[Mon Apr 30 06:33:03.081554 2012] [auth_digest:notice] [pid 3472:tid 160] AH01757: generating secret for digest authentication ...
[Mon Apr 30 06:33:03.084554 2012] [mpm_winnt:notice] [pid 3472:tid 160] AH00354: Child: Starting 64 worker threads.
[Mon Apr 30 06:33:15.744067 2012] [fcgid:warn] [pid 3472:tid 752] (OS 109)Ha terminado la canalización. : [client 127.0.0.1:20029] mod_fcgid: get overlap result error
[Mon Apr 30 06:33:15.745067 2012] [core:error] [pid 3472:tid 752] [client 127.0.0.1:20029] End of script output before headers: xphp-info.php

----
on Win 7 64 Ult sp1 // php 5.4.1
apacheLounge 2.4.2 - 64 / mod_fcgid-2.3.7-win64

---

Quote:
Be aware the Win32Service extension is only available when using the CLI SAPI (command line).
When you load it as extension when running as module or fast cgi then PHP does not start.


In same config but in PHP 5.3.11 run all ok

win32_stop_service("MiService");
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2880
Location: Hilversum, NL, EU

PostPosted: Mon 30 Apr '12 12:36    Post subject: Reply with quote

I asked what is in the php.log ?

Yep, I build with the trunk version and this contains a change that only in CLI is allowed.
See the second change from the top at http://svn.php.net/viewvc/pecl/win32service/trunk/win32service.c?view=log , it says: Don't load the extension unless using the CLI SAPI.


Steffen
Back to top
zx9



Joined: 18 Mar 2009
Posts: 33
Location: uruguay

PostPosted: Mon 30 Apr '12 13:02    Post subject: sorry Reply with quote

sorry Embarassed

phperror.log¬
[30-Apr-2012 10:53:14 UTC] PHP Warning: The Win32Service extension is only available when using the CLI SAPI in Unknown on line 0
[30-Apr-2012 10:53:14 UTC] PHP Fatal error: Unable to start win32service module in Unknown on line 0
----

Yes, say this , but I have mod_fcgid-2.3.7-win64 over PHP 5.3.11 and run ok
The problem is in new PHP version, 5.4.

for clarify my running script on PHP 5.3.11 VC9 NTS:

<?
$result=win32_query_service_status('MyService');

# WIN32_SERVICE_CONTINUE_PENDING 0x00000005 La continuación del servicio está pendiente.
# WIN32_SERVICE_PAUSE_PENDING 0x00000006 La pausa del servicio está pendiente.
# WIN32_SERVICE_PAUSED 0x00000007 El servicio está pausado.
# WIN32_SERVICE_RUNNING 0x00000004 El servicio está en ejecución.
# WIN32_SERVICE_START_PENDING 0x00000002 El servicio está iniciado.
# WIN32_SERVICE_STOP_PENDING 0x00000003 El servicio está detenido.
# WIN32_SERVICE_STOPPED 0x00000001 El servicio no está en ejecución.

$mask1 ='S:/SomeDir/data/*';
$mask2 ='S:/somedir/log/*';

if($result['CurrentState']==1) {# if 'MyService' is stoped, delete files
array_map( "unlink", glob( $mask ) );
usleep(30000);
array_map( "unlink", glob( $mask2 ) );

}else{# If 'MyService' runing, stop it, wait all stoped flag, then delete files
win32_stop_service('MyService');
$status=win32_query_service_status('MyService');
while($status['CurrentState']!=1){#NO SE DETIENE, ESPERA A DETENER
$status=win32_query_service_status('MyService');
usleep(30000);
}

# Delete files
array_map( "unlink", glob( $mask1 ) );
array_map( "unlink", glob( $mask2 ) );

}

win32_start_service('MyService');
?>

-------

OMG , wich is the way to have this extension (or this functions) on PHP 5.4.1 VC9 NTS , mod_fcgid-2.3.7-win64 ?? Sad

I need stop and start "MyService" , I only find this method on this extension, Thanks Sad
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2880
Location: Hilversum, NL, EU

PostPosted: Mon 30 Apr '12 13:43    Post subject: Reply with quote

I updated the zip with a nts-patched_no-cli-only.

Please test it and look in the php.log.

Please report back,

Steffen
Back to top
zx9



Joined: 18 Mar 2009
Posts: 33
Location: uruguay

PostPosted: Mon 30 Apr '12 14:22    Post subject: yehaaaaa You´r ROCK!!!! .... FLAWLESS VICTORY!!! FATALITY Reply with quote

yehaaaaa You´r ROCK!!!! .... FLAWLESS VICTORY!!! FATALITY Exclamation Exclamation Very Happy Very Happy




Thanks, Thanks, Thanks

-------
Next: "Tutorial for compiling extension for PHP TS/NTS for Full-Dummyes Idea
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2880
Location: Hilversum, NL, EU

PostPosted: Mon 30 Apr '12 14:54    Post subject: Reply with quote

Glad I could help.

Would you do some for us ?

Please post your script as example for others in the "Coding & Scripting Corner" forum.

Thanks,

Steffen
Back to top
zx9



Joined: 18 Mar 2009
Posts: 33
Location: uruguay

PostPosted: Mon 30 Apr '12 15:45    Post subject: - done Reply with quote

Done.
Back to top


Reply to topic   Topic: Win32Service extension for PHP 5.4.1 compiling errors View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads