Gentoo emerge安装nginx+php+mysql

Standard # nano /etc/portage/package.use
dev-lang/php cli cgi ctype mysql mysqli mssql pdo gd curl xml hash json soap sockets snmp
www-servers/nginx fastcgi ssl status
media-gfx/imagemagick jpeg png # nano /etc/portage/package.keywords
www-servers/spawn-fcgi ~x86
dev-php5/pecl-memcache ~x86 # emerge php nginx spawn-fcgi # nano /etc/nginx/nginx.conf
  http {
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 64k;
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 128k;
        server {
                listen          80;
                server_name     localhost;
                #access_log     /var/log/nginx/localhost.access_log main;
                #error_log      /var/log/nginx/localhost.error_log info;
                root /var/www/localhost/htdocs;
                index index.php index.html;
                location ~\.php$ {
                        fastcgi_index   index.php;
                        include fastcgi_params;
                        fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs$fastcgi_script_name;
  } # spawn-fcgi -a -p 9000 -C 5 -u nobody -g nobody -f /usr/bin/php-cgi # /etc/init.d/nginx start # emerge mysql # ebuild /var/db/pkg/dev-db/mysql-5.0.70-r1/mysql-5.0.70-r1.ebuild config # /etc/init.d/mysql start # nano /etc/conf.d/local.start
/usr/bin/spawn-fcgi -a -p 9000 -C 5 -u nobody -g nobody -f /usr/bin/php-cgi # rc-update add nginx default # rc-update add mysql default

APC Memcache Imagick之类的PHP扩展存放在/usr/portage/dev-php5/目录下.
可直接 emerge pecl-apc pecl-imagick pecl-memcache 进行安装.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.