diff --git a/manual-configurations.md b/manual-configurations.md new file mode 100644 index 0000000..92f0cb6 --- /dev/null +++ b/manual-configurations.md @@ -0,0 +1,12 @@ +# Minor tweeks + +## Allow `root` database access without password + +**Useful for development, insecure for production.** + +* Start the image: `docker run -d --name lamp --rm -p 80:80 -e DISPLAY_ERRORS=true -v /home/david/Development/php:/var/www/html fauria/lamp` +* Log into image: `docker exec -ti lamp bash` +* Log into DB: `mysql` +* Update user privileges: `UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root' AND plugin = 'unix_socket';` +* Flush privileges: `flush privileges;` +* Restart DB: `service mysql restart` diff --git a/run-lamp.sh b/run-lamp.sh index a8eeddb..a497cb0 100644 --- a/run-lamp.sh +++ b/run-lamp.sh @@ -28,6 +28,13 @@ fi # enable php short tags: /bin/sed -i "s/short_open_tag\ \=\ Off/short_open_tag\ \=\ On/g" /etc/php/7.0/apache2/php.ini +# display PHP errors: +if [ $DISPLAY_ERRORS ]; then + /bin/sed -i "s/display_errors\ \=\ Off/display_errors\ \=\ On/g" /etc/php/7.0/apache2/php.ini +else + DISPLAY_ERRORS='No.' +fi + # stdout server info: if [ ! $LOG_STDOUT ]; then cat << EOB @@ -46,6 +53,7 @@ cat << EOB · Log Level [LOG_LEVEL]: $LOG_LEVEL · Allow override [ALLOW_OVERRIDE]: $ALLOW_OVERRIDE · PHP date timezone [DATE_TIMEZONE]: $DATE_TIMEZONE + · PHP display errors [DISPLAY_ERRORS]: $DISPLAY_ERRORS EOB else