ãFuelPHPãNginx + FuelPHP ã®ç°å¢æ§ç¯ã¨åä½ç¢ºèª
ã©ããã
è¨äºã®ã¿ã¤ãã«ã«å¢¨ä»ã«ãã³ã¨ãä»ãã¦ã¿ãã
CakePHP ã§ã«ã¼ã«ãè¦ããã®ãé¢åã ãªã¨æã£ã¦ãFuelPHP ã«æãåºãã¦ã¿ãã
ã¤ãã§ã« Apache ã§ã¯ãªã Nginx ã«ããã
以ä¸ãæªæ¥ã®èªåã¸ä½ãã©ãããã®ãï¼ãæ®ãã¦ããã
â» history ã³ãã³ãã¨ç§ã®è¨æ¶ãé ¼ãã«è¨è¿°ãã¦ãã¾ãã
ï¼°ï¼£ç°å¢
Xubuntu 12.04 (32bit) on VMware
Nginx ã®ã¤ã³ã¹ãã¼ã«
$ sudo add-apt-repository ppa:nginx/stable $ sudo apt-get update $ sudo apt-get install nginx
Nginx ã®ã¤ã³ã¹ãã¼ã«ç¢ºèª
$ nginx -v nginx version: nginx/1.2.7
PHP ã®ã¤ã³ã¹ãã¼ã«
$ sudo add-apt-repository ppa:ondrej/php5 $ sudo apt-get update $ sudo apt-get install php5 php5-cgi php5-cli php5-mysql php5-gd php-apc php5-fpm php5-mcrypt
PHP ã®ã¤ã³ã¹ãã¼ã«ç¢ºèª
$ php -v PHP 5.4.14-1~precise+1 (cli) (built: Apr 11 2013 14:30:34) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
FuelPHP ã®ã¤ã³ã¹ãã¼ã«
- Fuel ãã¬ã¼ã ã¯ã¼ã¯ããã¦ã³ãã¼ãããã
- ãã¦ã³ãã¼ããããã¡ã¤ã«ã解åããå±éããã
- 以ä¸ã®ãã£ã¬ã¯ããªæ§é ã§é ç½®ããã
/usr/share/nginx/html/fuelphp/ âââ CHANGELOG.md âââ CONTRIBUTING.md âââ README.md âââ TESTING.md âââ build.xml âââ docs âââ fuel âââ oil âââ public ï¼æ¨©éãå¤æ´ãã¦ããï¼ $ sudo chmod -R 777 /usr/share/nginx/html/fuelphp/
Nginx ã®è¨å®
$ sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default_bak $ sudo leafpad /etc/nginx/sites-available/default
server { listen 80; listen [::]:80 ipv6only=on default_server; root /usr/share/nginx/html/fuelphp/public; server_name localhost; charset utf-8; index index.php; location / { try_files $uri /index.php?$uri&$args; } location ~* \favicon.ico$ { access_log off; expires 1d; add_header Cache-Control public; } location /doc/ { alias /usr/share/doc/; autoindex on; allow 127.0.0.1; allow ::1; deny all; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }
åä½ç¢ºèª
$ sudo service php5-fpm restart $ sudo service nginx restart
ï¼ãã©ã¦ã¶ã§ localhost ã¸ã¢ã¯ã»ã¹ï¼
以ä¸ã§ãã