This article is available in our new knowledge base: Commands to start and stop Zend Server for IBM i in a batch program or from the command line
Issue
Zend Server for IBM i installation provides an autostart job entry in susbsystem QSYSWRK to automatically start Zend Server at system start up, and menu options to allow for manually stopping and starting Zend Server. The commands in this article can be used to create custom programs to start or stop Zend Server at any desired time. The most common example would be a backup procedure that runs when the system is not in a restricted state.
Environment
Zend Server for IBM i Version 6 or higher running on any supported version of IBM i
Resolution
These are the commands to start and stop Zend Server. They correspond to options 1 and 2 on the Zend Server Service Management Menu. They will start and stop both the ZENDSVR6 subsystem and the ZENDSVR6 Apache instance in subsystem QHTTPSVR.
These commands must be run with a user profile possessing the *ALLOBJ and *JOBCTL special authorities.
Version 9
To start Zend Server:
ADDLIBLE ZENDPHP7
CALL ZENDPHP7/ZSTRSBS
To end Zend Server:
ADDLIBLE ZENDPHP7
CALL ZENDPHP7/ZENDSBS
Version 6, 7, or 8
To start Zend Server:
ADDLIBLE ZENDSVR6
CALL ZENDSVR6/ZSTRSBS
To end Zend Server:
ADDLIBLE ZENDSVR6
CALL ZENDSVR6/ZENDSBS
An alternative is to submit the commands:
Version 9
To start Zend Server:
SBMJOB CMD(CALL PGM(ZENDPHP7/ZSTRSBS)) +
JOB(START_ZSV) JOBD(ZENDPHP7/ZSVR_JOBD) +
JOBQ(QGPL/QBATCH)
To end Zend Server:
SBMJOB CMD(CALL PGM(ZENDPHP7/ZENDSBS)) +
JOB(STOP_ZSV) JOBD(ZENDPHP7/ZSVR_JOBD) +
JOBQ(QGPL/QBATCH)
Version 6, 7, or 8
To start Zend Server:
SBMJOB CMD(CALL PGM(ZENDSVR6/ZSTRSBS)) +
JOB(START_ZSV) JOBD(ZENDSVR6/ZSVR_JOBD) +
JOBQ(QGPL/QBATCH)
To end Zend Server:
SBMJOB CMD(CALL PGM(ZENDSVR6/ZENDSBS)) +
JOB(STOP_ZSV) JOBD(ZENDSVR6/ZSVR_JOBD) +
JOBQ(QGPL/QBATCH)
One way to start at startup is to put the commands to start the ZENDPHP7 or ZEDNSVR6 subsystem in the start up program defined by the QSTRUPPGM system value.
Comments