For the ZF3 app you need the DocumentRoot to point to the public folder of the app.

The server then uses the .htaccess file in that folder to rewrite the requests and pass the extra elements of the url as a query string to the index.php script located there.

When you do this the ZF3 app will take over the entire port. So accessing the url "http:/servername:port/" should open up the index.php landing page.

This would be a different setup than using the App Deployment.
In the App Deployment you will give the App a name.
Then you would access it using that name "http://servername:port/appname/";.

As far as using the ZendServer App Deployment, you would need to create the ZPK package file.
In that case you would develop the app, then include a deployment.xml that describes the app for ZendServer.
Then generate the ZPK file that is needed for App Deployment.
The deployment.xml file contains a docroot entry that should tell ZendServer how to update the Apache config.

Here is a documentation page that describes how to generate a ZPK file.

ZendServer should generate an updated apache config each time you redeploy the app. Which should fix the changing app folder location.
However, that means the config specific to the app must reside under the "zendphp7/etc/site.d" folder. In that folder, the " __default__" folder, or another folder named after the virtual host.

I could imagine you having some configuration issues if you had manually adjusted the apache config or if you didn't use the ZPK app deployment.

For our configuration of ZendServer 9 and zendphp7 and V7R3, the IBM Apache host is at /www/zendphp7/conf/httpd.conf.

The config file includes this line to pull in the ZendServer configs:
IncludeOptional /usr/local/zendphp7/etc/sites.d/vhost_*.conf

It looks like you added something similar. However, there may be issues if ZendServer doesn't see the includes they are expecting.

Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.

-----Original Message-----
From: OpenSource [mailto:opensource-bounces@xxxxxxxxxxxx] On Behalf Of Roche, Bob
Sent: Tuesday, July 31, 2018 8:29 AM
To: opensource@xxxxxxxxxxxx
Subject: [IBMiOSS] configuring PHP Zend framework on IBM

I am trying to get a Zend framework 3 application running on our IBM test system. I used Zend server create a virtual machine. Added an include to the HTTP config file since Zend server generates the virtual host in the wrong place for an IBM system. Restarted apache and the system recognizes the host. I then used Zend server to deploy a basic Zend framework 3 skeleton application. The first page displays, but the next test is to get a framework 404 page by trying to get to a page that does not exist. I get the apache 404 screen. If I can't get the framework 404, I'll never get the next page to display.

Zend server generated this:

<VirtualHost *:9003>

DocumentRoot "/usr/local/zendphp7/var/apps/http/cbs2/9003/_docroot_"
<Directory "/usr/local/zendphp7/var/apps/http/cbs2/9003/_docroot_">
Options +Indexes +FollowSymLinks
DirectoryIndex index.php
Order allow,deny
Allow from all
AllowOverride All

ServerName XXX:9003

# include the folder containing the vhost aliases for zend server deployment
Include "/usr/local/zendphp7/etc/sites.d/http/XXX/9003/*.conf"


I did add the listen statement to the apache config file. Previously I have tried several configurations based on what I can find online. Most placed the DocumentRoot all the way to the public directory. My issue with that is Zend server increments the directory structure each time you deploy the application. I saw a similar question in the IBM I forums at Zend/Rogue Wave from a few years ago. But it was never replied too.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].