Start
This commit is contained in:
commit
283bac61eb
4
README.md
Normal file
4
README.md
Normal file
@ -0,0 +1,4 @@
|
||||
# Тестовый проект для настройки NetBeans IDE
|
||||
|
||||
Используется в моей статье для наглядной демонстрации процесса настройки NetBeans + xdebug:
|
||||
https://axenov.dev/netbeans-php-docker-xdebug/
|
30
docker-compose.yml
Normal file
30
docker-compose.yml
Normal file
@ -0,0 +1,30 @@
|
||||
version: '3'
|
||||
|
||||
networks:
|
||||
test:
|
||||
driver: bridge
|
||||
|
||||
services:
|
||||
|
||||
php:
|
||||
container_name: test-php
|
||||
build: './php'
|
||||
networks:
|
||||
- test
|
||||
volumes:
|
||||
- ./php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
|
||||
- ./index.php:/var/www/index.php
|
||||
|
||||
nginx:
|
||||
container_name: test-nginx
|
||||
image: nginx:latest
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- test
|
||||
volumes:
|
||||
- ./nginx/vhost.conf:/etc/nginx/conf.d/default.conf
|
||||
- ./index.php:/var/www/index.php
|
||||
ports:
|
||||
- '8888:80'
|
||||
links:
|
||||
- php
|
6
index.php
Executable file
6
index.php
Executable file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$url = 'https://axenov.dev';
|
||||
$data = ['phpstorm', 'netbeans'];
|
||||
|
||||
phpinfo();
|
||||
//var_dump($data);
|
18
nginx/vhost.conf
Normal file
18
nginx/vhost.conf
Normal file
@ -0,0 +1,18 @@
|
||||
server {
|
||||
server_name test.local;
|
||||
listen 80;
|
||||
root /var/www/;
|
||||
index index.php;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
}
|
||||
location ~ \.php$ {
|
||||
try_files $uri /index.php =404;
|
||||
fastcgi_pass php:9000;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
9
php/dockerfile
Normal file
9
php/dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
FROM php:8.1-fpm
|
||||
|
||||
# https://pecl.php.net/package/xdebug
|
||||
RUN pecl channel-update pecl.php.net && \
|
||||
pecl install xdebug-3.1.6
|
||||
|
||||
EXPOSE 9000
|
||||
WORKDIR /var/www
|
||||
CMD php-fpm
|
7
php/php
Executable file
7
php/php
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
#echo ${BASH_ARGV[*]}
|
||||
docker exec test-php php \
|
||||
-dxdebug.mode=debug \
|
||||
-dxdebug.start_with_request=1 \
|
||||
`basename ${BASH_ARGV[0]}` \
|
||||
"${@:1:$#-1}"
|
9
php/xdebug.ini
Normal file
9
php/xdebug.ini
Normal file
@ -0,0 +1,9 @@
|
||||
[xdebug]
|
||||
; https://xdebug.org/docs/all_settings
|
||||
|
||||
zend_extension=xdebug.so
|
||||
xdebug.mode=debug
|
||||
xdebug.idekey=netbeans-xdebug
|
||||
xdebug.client_host=172.17.0.1
|
||||
xdebug.start_with_request=trigger
|
||||
xdebug.trigger=go
|
Loading…
Reference in New Issue
Block a user