Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ENABLE_SCRIPT_SERVER=1
# Default services configuration
# PHP
PHP_COVERAGE_OUTPUT_FOLDER=/opt/phpstorm-coverage
PHP_PROFILE_OUTPUT_FOLDER=/opt/phpstorm-profile

# Apache ports
APACHE_PORT_AUTO=88
Expand All @@ -27,6 +28,7 @@ APACHE_PORT_81=81
APACHE_PORT_82=82
APACHE_PORT_83=83
APACHE_PORT_84=84
APACHE_PORT_85=85

# Nginx ports (only used if ENABLE_NGINX=1)
NGINX_PORT_AUTO=88
Expand All @@ -37,6 +39,7 @@ NGINX_PORT_81=81
NGINX_PORT_82=82
NGINX_PORT_83=83
NGINX_PORT_84=84
NGINX_PORT_85=85

# Database ports
MARIADB_PORT=3306
Expand All @@ -54,6 +57,9 @@ MAILPIT_RELAY_MATCHING='(user\.combodo@gmail\.com|user@combodo\.com)'
# Script server
SCRIPT_SERVER_PORT=8090

# kCacheGrind
KCACHE_GRIND_WEB_PORT=8088

# SMTP password
COMBODO_SMTP_TEST_PASSWORD=!passboltpassword!

Expand Down
2 changes: 1 addition & 1 deletion addons/chrome_extension/assets/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const optionsDTO = {
php_version: '82',
url_filter: 'localhost',
enabled: 'true',
php_version_installed: '{"74":"7.4","80":"8.0","81":"8.1","82":"8.2","83":"8.3","84":"8.4"}'
php_version_installed: '{"74":"7.4","80":"8.0","81":"8.1","82":"8.2","83":"8.3","84":"8.4","85":"8.5"}'
};

// update badge from stored options
Expand Down
6 changes: 0 additions & 6 deletions addons/chrome_extension/assets/js/optionsDTO.js

This file was deleted.

2 changes: 1 addition & 1 deletion addons/chrome_extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "PHP Version Selector",
"version": "1.1",
"version": "1.2",
"description": "Select PHP version by modifying HTTP header request",
"options_ui": {
"page": "./pages/options.html",
Expand Down
2 changes: 1 addition & 1 deletion addons/chrome_extension/manifest_chrome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "PHP Version Selector",
"version": "1.1",
"version": "1.2",
"description": "Select PHP version by modifying HTTP header request",
"options_ui": {
"page": "./pages/options.html",
Expand Down
2 changes: 1 addition & 1 deletion addons/chrome_extension/manifest_firefox.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "PHP Version Selector",
"version": "1.1",
"version": "1.2",
"description": "Select PHP version by modifying HTTP header request",
"options_ui": {
"page": "./pages/options.html",
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion addons/docker_scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cd ../../
docker-compose build --no-cache
docker compose build --no-cache
3 changes: 2 additions & 1 deletion addons/docker_scripts/down.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
docker-compose down
cd ../../
docker compose --env-file .env.local down
3 changes: 3 additions & 0 deletions addons/docker_scripts/down_and_up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd ../../
docker compose --env-file .env.local down
docker compose --env-file .env.local up -d
10 changes: 10 additions & 0 deletions addons/docker_scripts/restart_php.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cd ../../
# Affichage en couleur
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color

echo -e "${RED}Stopping PHP containers...${NC}"
docker ps -a --format '{{.Names}}' | grep '^php[0-9]' | xargs -r docker stop
echo -e "${GREEN}Starting PHP containers...${NC}"
docker ps -a --format '{{.Names}}' | grep '^php[0-9]' | xargs -r docker start
2 changes: 1 addition & 1 deletion addons/docker_scripts/up.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cd ../../
docker-compose --env-file .env.local up -d
docker compose --env-file .env.local up -d
7 changes: 7 additions & 0 deletions addons/documentation/how_to.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,13 @@ https://mailpit.axllent.org/docs/configuration/smtp-relay/
* Add a configuration file in `conf/script-server/config/runners` folder describing your script (name, description, parameters, ... Full documentation [here](https://github.com/bugy/script-server/wiki/Script-config)).
* Restart the script-server container.

## kCacheGrind

### Open a cachegrind file

* Open the kcachegrind application http://localhost:8088/vnc.html?path=vnc&autoconnect=true&resize=remote&reconnect=true&show_dot=true.
* Click on "File" then "Open" and select the cachegrind file you want to open from the `data` folder.


\
\
Expand Down
Binary file modified addons/documentation/images/docker_infra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions build/default_configuration/php/php.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
memory_limit=512M
max_execution_time = 300
display_errors = On
log_errors = On
display_startup_errors = On
html_errors = On
error_reporting = E_ALL
zend_extension=opcache
opcache.enable=1
upload_max_filesize = 190M
opcache.enable=0
upload_max_filesize = 64M
post_max_size = 200M
max_input_vars = 5000
;allow_url_fopen = Off
Expand Down
6 changes: 4 additions & 2 deletions build/default_configuration/php/xdebug.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
xdebug.mode=debug
xdebug.client_host=host.docker.internal
xdebug.mode=debug,coverage,profile
xdebug.client_host=host.docker.internal
xdebug.output_dir=/opt/phpstorm-profile
xdebug.start_with_request = trigger
5 changes: 3 additions & 2 deletions build/php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ARG XDEBUG_VERSION
ARG UID=1000
ARG GID=1000

# Make sure www-data user has the same uid/gid as the host user to avoid permission issues
RUN usermod -u ${UID} www-data && groupmod -g ${GID} www-data

# Install @procps for "ps" & "pgrep" commands
Expand All @@ -15,11 +16,11 @@ RUN apt-get update && apt-get install -y procps
# Install @mariadb-client & @graphviz
RUN apt-get update && apt-get install mariadb-client graphviz -y

# install php extensions
# Install php extensions
COPY --from=ghcr.io/mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions gd xdebug apcu imap mysqli soap zip ldap

# install Composer
RUN set -eux; \
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php -r "if (hash_file('sha384', 'composer-setup.php') === 'c8b085408188070d5f52bcfe4ecfbee5f727afa458b2573b8eaaf77b3419b0bf2768dc67c86944da1544f06fa544fd47') { echo 'Installer verified'.PHP_EOL; } else { echo 'Installer corrupt'.PHP_EOL; unlink('composer-setup.php'); exit(1); }" && \
Expand Down
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ x-php: &default-php
- ${CONF_FOLDER}/msmtprc/msmtprc:/var/www/.msmtprc:ro
- ${HTML_FOLDER}:/var/www/html/
- ${DATA_FOLDER}/php/coverage:${PHP_COVERAGE_OUTPUT_FOLDER}
- ${DATA_FOLDER}/php/profile:${PHP_PROFILE_OUTPUT_FOLDER}
restart: always

services:
Expand Down Expand Up @@ -84,6 +85,15 @@ services:
IMAGE: php:8.4-fpm
XDEBUG_VERSION: 3.4.5

php85:
<<: *default-php
container_name: php8.5
build:
<<: *default-php-build
args:
IMAGE: php:8.5-fpm
XDEBUG_VERSION: 3.4.5

apache:
container_name: apache
build:
Expand All @@ -101,6 +111,7 @@ services:
- "${APACHE_PORT_82:-82}:82"
- "${APACHE_PORT_83:-83}:83"
- "${APACHE_PORT_84:-84}:84"
- "${APACHE_PORT_85:-85}:85"
volumes:
- ${CONF_FOLDER}/apache/httpd.conf:/usr/local/apache2/conf/httpd.conf
- ${CONF_FOLDER}/apache/httpd-vhosts.conf:/usr/local/apache2/conf/extra/httpd-vhosts.conf
Expand All @@ -114,6 +125,7 @@ services:
# - php82
# - php83
# - php84
# - php85
deploy:
replicas: ${ENABLE_APACHE:-0}

Expand All @@ -134,6 +146,7 @@ services:
- "${NGINX_PORT_82:-82}:82"
- "${NGINX_PORT_83:-83}:83"
- "${NGINX_PORT_84:-84}:84"
- "${NGINX_PORT_85:-85}:85"
volumes:
- ${CONF_FOLDER}/nginx:/etc/nginx/conf.d
- ${CONF_FOLDER}/certs:/etc/nginx/certs
Expand All @@ -146,6 +159,7 @@ services:
# - php82
# - php83
# - php84
# - php85
deploy:
replicas: ${ENABLE_NGINX:-0}

Expand Down Expand Up @@ -228,3 +242,12 @@ services:
- TZ=Europe/Paris
deploy:
replicas: ${ENABLE_SCRIPT_SERVER:-0}

kcachegrind:
image: nedix/kcachegrind
ports:
- ${KCACHE_GRIND_WEB_PORT:-8088}:80
volumes:
- ${DATA_FOLDER}/php/profile:/data


10 changes: 9 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The containers in charge of serving the web pages.
* `82` Serve pages based on PHP 8.2.
* `83` Serve pages based on PHP 8.3.
* `84` Serve pages based on PHP 8.4.

* `85` Serve pages based on PHP 8.5.

* `88` (Automatic Mode) To serve pages based on PHP version passed in request header `X-PHP-Version`.
* `443` (Automatic Mode) To serve pages based on PHP version passed in request header `X-PHP-Version` with `HTTPS` protocol.
Expand Down Expand Up @@ -161,7 +161,15 @@ Based on `bugy/script-server` image.
#### Default Listened Ports
* `8090` WebUI

### kCacheGrind
The container for xdebug profile analyze.

Web GUI to inspect Valgrind and Xdebug profiling reports.

🐳 [Docker official image page](https://hub.docker.com/r/nedix/kcachegrind)

#### Default Listened Ports
* `8088` WebUI



Expand Down