?
Solved

How to create a PHP Web Service in Windows

Posted on 2007-07-20
11
Medium Priority
?
344 Views
Last Modified: 2013-12-13
Hi All

I have ordered the book PHP Programming for Windows with some nice material on how to create a PHP webserice on Windows. The problem it will only be here in two weeks and I really need to do it now. Is there any good material on how to do this online. Please help.

mwskuzzy
0
Comment
Question by:mwskuzzy
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 19529645
Ideally, for a web service, you need a web server. Then PHP plugs into that (ISAPI/FCGI/CGI/etc).
0
 
LVL 23

Accepted Solution

by:
Stacy Spear earned 750 total points
ID: 19529663
0
 

Author Comment

by:mwskuzzy
ID: 19529676

I need to develop a web service in PHP for Windows. I have already learnt how to program in PHP on a web server. I am just looking for some good documentation or source code examples of how to create a PHP web service for Windows.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 23

Expert Comment

by:Stacy Spear
ID: 19529754
PHP is PHP. Whether windows or *AMP.

The folks on the other end of the service won't know or care what platform you are running on.
0
 
LVL 5

Expert Comment

by:cschand
ID: 19529860
0
 
LVL 11

Expert Comment

by:Chris Gralike
ID: 19530308
Use the server (where php acts as a service) code examples in your book and run the php script using the php.exe to run the script outside the webserver. Create a new service in windows using the "sc create" command on the command prompt and point it to the executable with the correct instructions. Do mind using appropriate service accounts rather then the default SYSTEM account services are ran under.

Grant this user "run as service account / batchjob" privs...

Start the service in windows, or use the scedurer if the script isnt in a loop for instance...

Regards,
0
 
LVL 11

Expert Comment

by:Chris Gralike
ID: 19530323
A nice example of a windows service in php is this one for example..

<?php
/* A sample service:
 *
 * php sample.php install
 * net start dummyphp
 * net stop dummyphp
 * php sample.php uninstall
 */

if ($argv[1] == 'install') {
      $x = win32_create_service(array(
            'service' => 'dummyphp',
            'display' => 'sample dummy PHP service',
            'params' => __FILE__ . ' run',
      ));
      debug_zval_dump($x);
      exit;
} else if ($argv[1] == 'uninstall') {
      $x = win32_delete_service('dummyphp');
      debug_zval_dump($x);
      exit;
} else if ($argv[1] != 'run') {
      die("bogus args");
}

$x = win32_start_service_ctrl_dispatcher('dummyphp');

while (WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message()) {
      usleep(250000);
}

?>
0
 

Author Comment

by:mwskuzzy
ID: 19530581
Guys....

He he.....thank you all for your suggestions but I require help to create a WEB SERVICE (as in SOAP, XML) not a windows service.
0
 

Author Comment

by:mwskuzzy
ID: 19530606
In a nutshell I need to do the following:

1. Create a PHP web service with the required methods.
2. Create a WSDL file from the web service
3. Import the WSDL file into Delphi
4. Call the methods
0
 
LVL 23

Expert Comment

by:Stacy Spear
ID: 19531002
Did you even read the link I posted? Which walks you through the creation of a web service?
0
 

Author Comment

by:mwskuzzy
ID: 19545342
Hi darkstart3d

I read through the link you posted and it does help yes but not in the detail required. It seems as though to create a web service in PHP you need to manually create your WSDL file for your web service. The details on how to do this arent very thorough but w3schools.com com has a fairly decent turorial on WSDL files. There are a few applications to create these files through a GUI but the cost dosent justify it as I only need one file. The great thing is that i get a chance to get my hands dirty and learn the nitty gritty of how a WSDL file works.

Regards
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question