php5.6 incolude redis-ext,memcached-ext and nginx
336
docker pull leitaozhang/phpserver
docker run --name mymemcache -p 11211:11211 -d memcached memcached -m 64
docker run --name mysql -p 3306:3306 -v ~/docker/mysql/datadir:/var/lib/mysql -v ~/docker/mysql/config:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7.22
docker run --name mylnmp -d -p 80:80 --link mymemcache --link mysql -v ~/PhpstormProjects:/var/www:ro -v ~/docker/nginx/config:/var/nginx/config:ro leitaozhang/phpserver
--- 配置php5.6版本---
server {
listen 80;
server_name localhost ;
access_log /tmp/nginx_logs/localhost.access.log main;
root /var/www/localhost/;
index index.php index.html index.htm;
location ~ \.php$ {
fastcgi_pass unix:/dev/shm/php56-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
---或则配置php7.1版本---
server {
listen 80;
server_name localhost ;
access_log /tmp/nginx_logs/localhost.access.log main;
root /var/www/localhost/;
index index.php index.html index.htm;
location ~ \.php$ {
fastcgi_pass unix:/dev/shm/php71-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
---或则配置php7.3版本---
server {
listen 80;
server_name localhost ;
access_log /tmp/nginx_logs/localhost.access.log main;
root /var/www/localhost/;
index index.php index.html index.htm;
location ~ \.php$ {
fastcgi_pass unix:/dev/shm/php73-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
可以根据不同需求而定制
Content type
Image
Digest
Size
370.6 MB
Last updated
over 7 years ago
docker pull leitaozhang/phpserver