Hello,
I try for a few days now to run a project zend-expressive on my production server but I can not.
The production server has the following configuration:
CentOS Linux release 7.2.1511 (Core)
PHP 5.6.20 (cli) (built: Apr 2 2016 07:51:15)
Copyright © 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright © 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright © 1999-2016, by Zend Technologies
Server version: Apache / 2.4.6
Loaded Modules:
core_module (static), so_module (static), http_module (static), access_compat_module (shared), shares_module (shared), shared_module (shared), allowmethods_module (shared), auth_basic_module (shared), auth_digest_module (shared), authn_anon_module (shared), authn_core_module (shared), authn_dbd_module (shared), authn_dbm_module (shared), authn_file_module (shared), authn_socache_module (shared), authz_core_module (shared), authz_dbd_module (shared), authz_dbm_module (shared), authz_groupfile_module (shared), authz_host_module (shared), authz_owner_module (shared), authz_user_module (shared), autoindex_module (shared), cache_module (shared), cache_disk_module (shared), data_module (shared), dbd_module (shared), deflate_module (shared), dir_module (shared), dumpio_module (shared), echo_module (shared), env_module (shared), expires_module (shared), ext_filter_module (shared), filter_module (shared), headers_module (shared), include_module (shared), info_module (shared), log_config_module (shared), shared (shared), mime_magic_module (shared), mime_module (shared), shared_module (shared), remote_module (shared), shared (shared), rewtime_module (shared), setenvif_module (shared), slotmem_plain_module (shared), slotmem_shm_module (shared), socache_dbm_module (shared), socache_memcache_module (shared), shared_share (shared) shared, dav_module (shared), dav_module_module (shared), dav_module_module (shared), dav_module_module (shared), shared_module (shared), shared_module (shared), shared_module (shared), shared_module (shared), sharedmodule (shared), lbmethod_heartbeat_module (shared), proxy_ajp_module (shared), proxy_balancer_module (shared), proxy_connect_module (shared), proxy_express_module (shared), proxy_fcgi_m shared, proxy_fdpass_module (shared), proxy_ftp_module (shared), proxy_http_module (shared), proxy_scgi_module (shared), proxy_wstunnel_module (shared), ssl_module (shared), systemd_module (shared), cgi_module (shared), ldap_module (shared), authnz_ldap_module (shared), php5_module (shared)
the z_default.conf file:
NameVirtualHost *: 80
<VirtualHost *: 80>
ServerAdmin webmaster @ localhost
ServerName prod.service
DocumentRoot /var/www/
ErrorLog /etc/httpd/logs/error_log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /etc/httpd/logs/access_log combined
ServerSignature On
<Directory />
FollowSymLinks options
AllowOverride None
</Directory>
Include /etc/httpd/conf.d/applications/*.conf
</ VirtualHost>
In the file /etc/httpd/conf.d/applications/expressive.conf:
Alias /expressive "/data/expressive"
<Directory "/data/expressive">
Options Indexes MultiViews FollowSymlinks
AllowOverride None
Require all granted
</Directory>
I think I have everything for the configuration.
To create my project I use the following command in the directory /data/:
composer create-project zendframework/zend-expressive-expressive skeleton
I select modular, zend-servicemanager, fast router and flat template and whoops
I am giving a 404 error when I want to display the homepage in my browser.
I followed the following instructions: https://docs.zendframework.com/zend-expressive/v2/cookbook/using-a-base-path/
I used los/basepath
and I still get a 404 error, I had to add this line to the /config/pipeline.php file just before routing:
$ App-> pipe (LosMiddleware\BasePath\BasePath::class);
Finally the home page is displayed but the problem is that when I click on the link “ping test” I get an error “/api/ping not found”.
Would you have a solution to this problem?
thanks in advance