restartPHP

This method restarts PHP on all servers or on specified servers in the cluster. A 202 response in this case does not always indicate a successful restart of all servers. Use the clusterGetServerStatus command to check the server(s) status again after a few seconds.

 

 

Required Permissions: full

HTTP method: POST

Supported by Editions: All

Request Parameters:

Parameter

 Type

Required

Description

servers

Array

No

A list of server IDs to restart. If not specified, all servers in the cluster will be restarted. In a single Zend Server context this parameter is ignored.

parallelRestart

Boolean

No

Sends the restart command to all servers at the same time. The default value is "FALSE".

 

Expected Response Code: 202 Accepted

Response Type: serversList with the status of all servers to which the restart command was requested (i.e. the servers provided in the servers parameter or all servers if no servers are specified).

Possible Action Specific Error Codes:

HTTP Code

 Error Code

Description

404

noSuchServer

One or more of the provided server IDs does not exist. In this case, no servers are restarted.

500

restartFailed

Restarting at least some of the servers failed. This response is only possible when working with a cluster.

 

Usage Example

Example:

Request (headers removed for clarity):

POST /ZendServerManager/Api/restartPhp
servers%5B0%5D=1&servers%5B1%5D=2

Response:

HTTP/1.0 202 Accepted
<?xml version="1.0" encoding="UTF-8"?>
<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.0">
    
  <requestData>
    <apiKeyName>angel.eyes</apiKeyName>
    <method>restartPhp</method>
  </requestData>
  
  <responseData>
    <serversList>
      <serverInfo>
        <id>1</id>
        <name>www-01</name>
        <address>https://www-01.local:10082/ZendServer</address>
        <status>restarting</status>
        <messageList />
      </serverInfo>
      <serverInfo>
        <id>2</id>
        <name>www-02</name>
        <address>https://www-02.local:10082/ZendServer</address>
        <status>restarting</status>
        <messageList />
      </serverInfo>
      <serverInfo>
        <id>3</id>
        <name>www-03</name>
        <address>https://www-03.local:10082/ZendServer</address>
        <status>OK</status>
        <messageList />
      </serverInfo>
    </serversList>
  </responseData>
</zendServerAPIResponse>

 

 

 

Related Links

Related Links:

Server and Cluster Management Methods