Skip to content

Commit

Permalink
Added missing cap from DC file to give permission to set system time …
Browse files Browse the repository at this point in the history
…based off host... you need to add that to get the systems times working....

Also wrapped the xdebug in an if, so you now need to add PHP_XDEBUG_ENABLED=true to turn it on, because it can be a PITA and a nice raw error is sometimes nice (instead of hiding stuff from me)
  • Loading branch information
smiffy6969 committed Feb 11, 2018
1 parent cf75606 commit e7e825b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ __PHP_SESSION_COOKIE_DOMAIN:__ Maps to php.ini 'session.cookie_domain'

__PHP_SESSION_COOKIE_HTTPONLY:__ Maps to php.ini 'session.cookie_httponly'

__PHP_XDEBUG_ENABLED:__ Add this env and give it a value to turn it on, such as true, or On or Awesome, or beer, or socks... Turns on xdebug (which is not for production really)


## Usage

Expand All @@ -117,10 +119,15 @@ services:
- PHP_ERROR_REPORTING=E_ALL
- PHP_DISPLAY_ERRORS=On
- PHP_HTML_ERRORS=On
- PHP_XDEBUG_ENABLED=true
networks:
- default
volumes:
- ./:/app
# ADD in permission for setting system time to host system time
cap_add:
- SYS_TIME
- SYS_NICE
networks:
default:
external:
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ services:
- PHP_ERROR_REPORTING=E_ALL
- PHP_DISPLAY_ERRORS=On
- PHP_HTML_ERRORS=On
- PHP_XDEBUG_ENABLED=true
networks:
- default
volumes:
- ./public:/app
cap_add:
- SYS_TIME
- SYS_NICE
networks:
default:
external:
Expand Down
17 changes: 10 additions & 7 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,16 @@ if [ ! -z "$PHP_SESSION_COOKIE_DOMAIN" ]; then sed -i "s/\;\?\\s\?session.cookie
if [ ! -z "$PHP_SESSION_COOKIE_HTTPONLY" ]; then sed -i "s/\;\?\\s\?session.cookie_httponly = .*/session.cookie_httponly = $PHP_SESSION_COOKIE_HTTPONLY/" /etc/php7/php.ini && echo "Set PHP session.cookie_httponly = $PHP_SESSION_COOKIE_HTTPONLY..."; fi

# enable xdebug coverage for testing with phpunit (already installed)
echo "Enable XDebug for unit testing..."
echo 'zend_extension=/usr/lib/php7/modules/xdebug.so' >> /etc/php7/php.ini;
echo 'xdebug.coverage_enable=On' >> /etc/php7/php.ini;
echo 'xdebug.remote_enable=1' >> /etc/php7/php.ini;
echo 'xdebug.remote_connect_back=1' >> /etc/php7/php.ini;
echo 'xdebug.remote_log=/tmp/xdebug.log' >> /etc/php7/php.ini;
echo 'xdebug.remote_autostart=true' >> /etc/php7/php.ini;
if [ ! -z "$PHP_XDEBUG_ENABLED" ]
then
echo "Enable XDebug..."
echo 'zend_extension=/usr/lib/php7/modules/xdebug.so' >> /etc/php7/php.ini;
echo 'xdebug.coverage_enable=On' >> /etc/php7/php.ini;
echo 'xdebug.remote_enable=1' >> /etc/php7/php.ini;
echo 'xdebug.remote_connect_back=1' >> /etc/php7/php.ini;
echo 'xdebug.remote_log=/tmp/xdebug.log' >> /etc/php7/php.ini;
echo 'xdebug.remote_autostart=true' >> /etc/php7/php.ini;
fi

# Start (ensure apache2 PID not left behind first) to stop auto start crashes if didn't shut down properly

Expand Down

0 comments on commit e7e825b

Please sign in to comment.