Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Shell C HTML Groff Nginx PHP Other
Branch: master
Pull request Compare This branch is 437 commits ahead, 35 commits behind jbayer:master.
Failed to load latest commit information.
conf Fix default vhost configuration file
nothing-src Zend Server 7.0 upgrade Merge branch 'zendtech-master' into zendtech-bluemix Zend Server 7.0 upgrade Add ZEND_DB2_DRIVER env. variable description.
json-env-extract.php Modify json-env-extract.php to prevent stderr useless messages


Welcome to the Zend Server PHP buildpack! This buildpack allows you to deploy your PHP apps on Cloud Foundry using Zend Server 8.5. Zend Server's integration with Cloud Foundry allows you to quickly get your PHP applications up and running on a highly available PHP production environment which includes, amongst other features, a highly reliable PHP stack, application monitoring, troubleshooting, and the new and innovative new technology - Z-Ray. Z-Ray gives developers unprecedented visibility into their code by tracking and displaying in a toolbar live and detailed info on how the various elements constructing their page are performing.


  • New cflinuxfs2 stack - since Zend Server 8.5 release this buildpack requires new Ubuntu 14.04 based stack.

Buildpack Components

  • Zend Server 8.5 Enterprise edition
  • Zend Server 8.5 configuration files
  • PHP 5.6
  • Apache web server


  • Zend Server 8.5
  • PHP 5.6
  • All Zend Server 8.5 extensions
  • Ability to work in cluster mode where all instances of application share their Zend Server settings
  • Automatic composer dependecies installation during deployment
  • Zutomatic Zend Server ZPK deployment
  • Automatic inclusion of DB2 CLI and PHP DB2 extensions if DB2 services are linked


  • .zpk - a .zpk or a Zend Application Package is basically a compressed file containing all your application data for the purpose of deployment on Zend Server, and can also be used to deploy libraries. For more information on .zpks, please visit the Zend Server Online Help at:
  • Zend Server Cluster - when deploying application that has MySQL service linked to it, all instances of application will automatically form a cluster where all settings (PHP settings, deployed ZPKs, Zend Server components settings, etc.) are shared and automatically synced when they are changed using Zend Server UI.


  1. Download and install Cloud Foundry's 'cf v6' CLI. For installation instructions, see
  2. Create a new folder on your workstation, and access it.
  3. If you have an application package (.zpk) ready for deployment, place it anywhere in your application. If not, create a new 'index.php' file in the root folder of your application, and paste the following code:

    echo "Hello world!";
  4. Enter the following command: cf push <application name> -m 512M -s cflinuxfs2 -b Your application is deployed using the Zend Server buildpack. This may take a few minutes. Note: If you are using Composer to manage library dependencies, make sure the 'composer.json' file is located in the root folder of your application. Your dependecies will be installed together with your application. Note 2: This buildpack uses new Ubuntu 14.04 based stack and won't run on older Ubuntu 10.04 based stack (lucid64).
  5. Once successfully initialized and deployed, a success message with the URL at which your application is available at is displayed.
  6. To access the application, enter the supplied URL in your Web browser. Deployed .zpks can be accessed at: http://<application URL>/<.zpk name>
  7. To access Zend Server, add 'ZendServer' to the supplied URL. For example:http://<application URL>/ZendServer The Zend Server Login page is displayed.
  8. Log in using the following credentials: Username - admin, Password - enter the following command in your CLI to retrieve an initial password: cf files <application name> /app/zend-password
  9. To change the Zend Server UI password, or in case you misplace your password, enter the following command: cf set-env <application name> ZS_ADMIN_PASSWORD <new password>. After this you may have to redeploy your application using cf push command.
  10. To use Z-Ray, enable it first. Go to the Configurations | Z-Ray page in the Zend Server UI, and select Enabled. Once enabled, simply open your app in a browser.

Automatically Importing PHP Configurations

The Zend Server buildpack can optionally import PHP configurations from backup files. This allows you to easily deploy applications which require a change of directives. It also allows you to retain changes you made using the Zend Server UI. To do so, follow these instructions:

  1. In your application's code (on your workstation) create a folder named .zend_config.
  2. Browse to: http://<application URL>/ZendServer/ImportExport/.
  3. Click on the "Export Configuration" button.
  4. Move the saved file to the .zend_config folder in your app.
  5. Change directory into your app source code directory: cd <app_source_directory_on_your_workstation>
  6. Enter the following command to apply the changes: cf push

Tip: you can reuse these backup files for other applications that might require similar settings.

Known Issues

  • Zend Server Code Tracing may not work properly in this version.
  • Several issues might be encountered if you do not bind MySQL providing service to the app (mysql/MariaDB):
    • You can change settings using the Zend Server UI and apply them - but they will not survive application pushes and restarts, nor will they be propagated to new application instances.
    • Application packages deployed using Zend Server's deployment mechanism (.zpk packages) will not be propagated to new app instances.
    • Zend Server will not operate in cluster mode.
  • Application generated data is not persistent (this is a limitation of Cloud Foundry) unless saved to a third party storage provider (like S3).
  • MySQL is not used automatically - If you require MySQL then you will have to setup your own server and configure your app to use it.
  • If the application does not contain an 'index.php' file you will most likely encounter a "403 permission denied error".

Additional Resources

The following resources will help you understand Cloud Foundry concepts and workflows:

User Feedback

Think we’ve missed something? Let us know at:

Something went wrong with that request. Please try again.