From 94e186baf504c145e9ca00a6a27a29e7b3de7633 Mon Sep 17 00:00:00 2001 From: asus Date: Sun, 4 Feb 2024 14:45:08 +0100 Subject: [PATCH] - resolve error in makefile new rule - supress script for wordpress entrypoint when wp is already installed, it was causing error in redirection --- Makefile | 4 ++-- .../wordpress/conf/wp_entrypoint.sh | 24 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index bd3a1a6..fdcd65c 100644 --- a/Makefile +++ b/Makefile @@ -132,9 +132,9 @@ erase_volume: - rm -rf $(VOLUMES_D) erase: erase_volume fclean - rm -rf $(VOLUMES_D) -new: erase $(NAME) +new: erase all -.PHONY : all $(VOLUMES_D) require build up list clean fclean re erase new require +.PHONY : all logs create_env create_volumes_d add_url_host require build build_logs up down list clean fclean-images fclean-volumes fclean re erase_volume erase new diff --git a/srcs/requirements/wordpress/conf/wp_entrypoint.sh b/srcs/requirements/wordpress/conf/wp_entrypoint.sh index a76fef3..6bd7293 100644 --- a/srcs/requirements/wordpress/conf/wp_entrypoint.sh +++ b/srcs/requirements/wordpress/conf/wp_entrypoint.sh @@ -62,19 +62,21 @@ then else echo -e ${GREEN}wp is installed${RESET} - - #https://stackoverflow.com/questions/56344567/wordpress-prevent-redirection-to-main-url - echo -e ${YELLOW}checking config.php file with current url...${RESET} - HOME=$(php wp-cli.phar config get WP_HOME --path=${WP_VOLUME_DIR}) - if [ ${HOME} != ${WP_COMPLETE_URL} ] ; then - php wp-cli.phar config set WP_HOME ${WP_COMPLETE_URL} --path=${WP_VOLUME_DIR} - fi - SITEURL=$(php wp-cli.phar config get WP_SITEURL --path=${WP_VOLUME_DIR}) - if [ ${SITEURL} != ${WP_COMPLETE_URL} ] ; then - php wp-cli.phar config set WP_SITEURL ${WP_COMPLETE_URL} --path=${WP_VOLUME_DIR} - fi fi +# https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/ +echo -e ${YELLOW}configuring the error logs...${RESET} +# Enable WP_DEBUG mode +php wp-cli.phar config set WP_DEBUG true --raw --path=${WP_VOLUME_DIR} +# Enable Debug logging to the /wp-content/debug.log file +#php wp-cli.phar config set WP_DEBUG_LOG /var/log/tmp_errors.log --raw --path=${WP_VOLUME_DIR} +php wp-cli.phar config set WP_DEBUG_LOG true --raw --path=${WP_VOLUME_DIR} +# Disable display of errors and warnings +php wp-cli.phar config set WP_DEBUG_DISPLAY false --raw --path=${WP_VOLUME_DIR} + + + + # exec php-fpm7 -FR # php-fpm7 --help :