Zf With Nginx (directory Alias)

  • Uploaded by: Krisna
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Zf With Nginx (directory Alias) as PDF for free.

More details

  • Words: 176
  • Pages: 2
Zend Framework with Nginx (Directory Alias) Notice: If you didn't know how to run PHP within Nginx, just follow my previous article: PHP5 with Nginx + FastCGI. ZF installation: $ su Password: # cd /to/your/download/path/ # unzip -q ZendFramework-1.9.1-minimal.zip -d /usr/local/ # mv /usr/local/ZendFramework-1.9.1-minimal /usr/local/zendframework # ln -s /usr/local/zendframework/bin/zf.sh /usr/local/bin/zf # zf show version Zend Framework Version: 1.9.1 Creating new ZF project: $ cd /to/your/project/path/ $ zf create project belajar-zf Creating project at /your/project/path/belajar-zf $ ln -s /usr/local/zendframework/library/Zend /your/project/path/belajar-zf/library/ Configuring Nginx: # vim /etc/nginx/sites-available/default ... server { listen 82; server_name localhost; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { root /var/www; index index.html index.php; } location ~ ^/belajar-zf/(.*\.php)$ { alias /your/project/path/belajar-zf/public/$1; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 256k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on;

Page 1 of 2

include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } location /belajar-zf/ { alias /your/project/path/belajar-zf/public/; index index.php; if (!-e $request_filename) { rewrite ^/(.*)$ /belajar-zf/index.php last; break; } } ... } :wq # /etc/init.d/nginx restart Restarting nginx: nginx. Test with browser: http://localhost:82/belajar-zf/

Page 2 of 2

Related Documents

Zf
November 2019 11
Zf
November 2019 27
Zf Materie
November 2019 14
Alias Commands1
December 2019 34

More Documents from "sv swamy"