Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP scripts not executed properly by default #2486

Closed
IngwiePhoenix opened this issue Jan 31, 2020 · 3 comments
Closed

PHP scripts not executed properly by default #2486

IngwiePhoenix opened this issue Jan 31, 2020 · 3 comments
Labels

Comments

@IngwiePhoenix
Copy link

Info:

  • Docker version ($ docker --version): Docker version 19.03.5, build 633a0ea
  • Laradock commit ($ git rev-parse HEAD): ad2b455be577669aa599f3511704565e6a806629
  • System info (Mac, PC, Linux): Windows 10 (1909)

Issue:

Per default, PHP scripts do get sent to php-fpm, but unfortunately they turn up unprocessed on the client-side. This behaviour is seen with Caddy, Apache2 and NGINX. The logs do show that php-fpm is processing the file - however, the PHP tags are shown raw on the client, indicating that the unprocessed output was sent.

Expected behavior:

I expected curl -v localhost to return a properly processed PHP output. Instead, it even asks me to append --output - to my command, as the data sent indicates that it is sent as binary, although Content-Type is set correctly.

Reproduce:

I changed the following in my .env:

$ diff .env env-example
8c8
< APP_CODE_PATH_HOST=../app
---
> APP_CODE_PATH_HOST=../
17c17
< DATA_PATH_HOST=../.laradock/data
---
> DATA_PATH_HOST=~/.laradock/data
33c33
< COMPOSE_PATH_SEPARATOR=;
---
> COMPOSE_PATH_SEPARATOR=:
36c36
< COMPOSE_PROJECT_NAME=elchflohmarkt
---
> COMPOSE_PROJECT_NAME=laradock
42c42
< PHP_VERSION=7.4
---
> PHP_VERSION=7.3
96c96
< WORKSPACE_INSTALL_NPM_GULP=false
---
> WORKSPACE_INSTALL_NPM_GULP=true
98c98
< WORKSPACE_INSTALL_NPM_VUE_CLI=false
---
> WORKSPACE_INSTALL_NPM_VUE_CLI=true
100c100
< WORKSPACE_INSTALL_PHPREDIS=false
---
> WORKSPACE_INSTALL_PHPREDIS=true
103c103
< WORKSPACE_INSTALL_XDEBUG=true
---
> WORKSPACE_INSTALL_XDEBUG=false
136c136
< WORKSPACE_INSTALL_IMAGEMAGICK=true
---
> WORKSPACE_INSTALL_IMAGEMAGICK=false
143c143
< WORKSPACE_INSTALL_LIBPNG=true
---
> WORKSPACE_INSTALL_LIBPNG=false
170c170
< PHP_FPM_INSTALL_PHPREDIS=false
---
> PHP_FPM_INSTALL_PHPREDIS=true
214c214
< PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 de_DE.UTF-8"
---
> PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8"
254c254
< LARAVEL_HORIZON_INSTALL_PHPREDIS=false
---
> LARAVEL_HORIZON_INSTALL_PHPREDIS=true

And then simply usd docker-compose up nginx php-fpm mysql. To test the other services, I replaced nginx with either apache2 or caddy.

Relevant Code:

I tried to display this file with the name index.php:

<html>
  <head>
    <title>o.o</title>
  </head>
  <body>
    <h1>Yo!</h1>
    <p><?php echo "Printed."; ?></p>
  </body>
</html>
@IngwiePhoenix
Copy link
Author

I figured it out... it was file encoding.

UTF-16 LE was somehow applied to my file and completely not do-able by Docker. I probably didn't make the file with VSCode but on the command line. Be aware, this has only happened to me on Windows so far.

Leaving the issue open for it to be seen.

@stale
Copy link

stale bot commented Apr 30, 2020

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs. Thank you for your contributions ❤️.

@stale stale bot added the Stale label Apr 30, 2020
@stale
Copy link

stale bot commented May 21, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant