docker-php | PHP 8 development environment with PHP-FPM , Nginx | Continuous Deployment library
kandi X-RAY | docker-php Summary
kandi X-RAY | docker-php Summary
PHP 8 development environment with PHP-FPM, Nginx and MySQL, using Docker and Docker Compose.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of docker-php
docker-php Key Features
docker-php Examples and Code Snippets
Community Discussions
Trending Discussions on docker-php
QUESTION
I'm working on a Dockerized project which has an Adminer container. I need to increase the value of post_max_size found in /usr/local/etc/php/conf.d/0-upload_large_dumps.ini.
My problem is any attempt to edit the file results in permission denied responses. Usually, this would be a prolem resolved by using sudo but I also get permission denied from that as well.
The following is the output of the directory I'm trying to edit showing the target file is owned by root:
...ANSWER
Answered 2022-Apr-08 at 19:05There is nothing to change in your docker-compose.yaml
.
If you want to change it, you can just exec
in the container as the root user.
So I suppose that, right now, you are doing
QUESTION
I try installing Informix with PDO locally and on docker, each way leads to the same failing tests.
I'm not sure if 'just' the tests are failing because some configuration would be needed to make them run, while the client / pdo would work fine if I start working on these.
Update:
It turns out that the PDO works even though the make test all fail.
Meaning with below Dockerfile it is possible to spin up a PHP-8.0 Informix 4.50 PDO_INFORMIX 1.3.6 container (you need to download the IBM Informix CSDK and the PDO first)
Dockerfile
...ANSWER
Answered 2022-Mar-30 at 11:51With this docker-compose and the dockerfile mentioned in the question above, a workable solution can be established.
Ensure the tmp folder for the DB exists and can be written to
QUESTION
In my Laravel project I upgraded to currently latest Laravel 9.3.0 and PHP 8.0.16.
The original version was Laravel 8.64 with PHP 7.4.
I run the project in Docker containers with php:8.0.16-fpm-alpine
image. Previous was php:7.4-fpm-alpine
.
This is my Docker container config in docker-compose.yml
file:
ANSWER
Answered 2022-Mar-03 at 08:28You can use in Dockerfile for solving memory limitation
QUESTION
I have just started using Docker as it has been recommended to me as something that makes development easy, but so far it has been nothing but pain. I have installed docker engine (v20.10.12)
and docker composer (v 2.2.3)
as per the documentation given by docker for Ubuntu OS. Both work as intended.
Whenever I new up a new container with docker compose
, no matter the source, I have writing privilege issues to files generated by the docker container (for example a laravel application where I have used php artisan to create a controller file). I have so far pinpointed the issue to be as follows:
By default docker runs as root within the container. It "bridges" the root user to the root user on the local machine and uses root:root
to create files on the Ubuntu filesystem (my workspace is placed in ~/workspace/laravel
). Then when opening the files in an IDE (vscode
in this instance) I get the error:
ANSWER
Answered 2022-Mar-15 at 15:27In general, this is not possible, but there are workarounds (I do not recommend them for production). The superuser UID is always 0, this is written in the kernel code. It is not possible to automatically change the ownership of non-root files. In this case, when developing, you can use these methods:
If superuser rights are not required: You can create users dynamically, then docker-compose.yml:
QUESTION
When I install php from aline, I use the form php-something.
Taking gd as an example, I install php8-gd using RUN apk add php8-gd
But I also saw an example using docker-php-ext-install .
For example, RUN docker-php-ext-install gd
This is not only gd, but also mysqli, bcmath, etc.
How are the two commands different?
...ANSWER
Answered 2022-Mar-04 at 00:50apk
downloads pre-built binaries from the Alpine Linux repository.
docker-php-ext-install
unpacks the source code of the extension and compiles it. This can be used with other base images, not just Alpine
Both are reasonable choices, but you need to choose one and stick with it. You cannot mix and match the commands, because it is highly likely you will end up with either broken software or duplicate software in your docker container.
QUESTION
So first of all since October for some reason my previously working Xdebug config for VSCode + Docker stopped working.
I switched over to an Xdebug 3 config to try it out, since 2.9 appears to have stopped working for me. Maybe because of a VSCode or PHP Debug plugin update?
But so far I have been unable to get it working or get it working only half?
VSCode launch.json:
...ANSWER
Answered 2022-Jan-11 at 12:58If you are using vscode IDE, than check your port in launch.json file. keep it 9000 and restart your vscode.
you can copy launch.json file from here.
QUESTION
I'm using ECS with Fargate and trying to create a bind mount on ephemeral storage but my user (id 1000) is unable to write to the volume.
According to the documentation, it should be possible.
However the documentation mentions:
By default, the volume permissions are set to
0755
and the owner as root. These permissions can be customized in the Dockerfile.
So in my Dockerfile I have
...ANSWER
Answered 2022-Feb-17 at 14:15Turns out /var/run
is a symlink to /run
in my container and ECS wasn't able to handle this. I changed my setup to use /run/php
instead of /var/run/php
and everything works perfectly.
QUESTION
I've recently begun trying to Dockerize my services and I'm to the point of Dockerizing everything that already has an image built. Now I'm trying to build an image for facileManager (FM) which doesn't yet have one. I've got it mostly working but I'm having an issue when running it behind Nginx. FM is normally an apache-php app and doesn't include install instructions for Nginx. What I've noticed with my container/image is that it works ok when I connect directly to it through a published port but if I try to connect to it through Nginx it errors out complaining about the .htaccess file not working. I'm not an expert in either Apache or Nginx so I did my Googleing but didn't come up with much beyond Wordpress having a similar issue with it's "pretty urls" so I'm hoping someone here can give a hand.
First here is the Github repo for the app: https://github.com/WillyXJ/facileManager/tree/ea159f5f6112727de8422c552aa05b6682aa4d79/server
The .htaccess file specifically is:
...ANSWER
Answered 2022-Feb-08 at 07:21Dot Points:
- include $request_uri in your proxy pass
- provide a resolver in your proxy location block
- declare an entry for your container in Docker's network stack
- use all lower case in your service name
Below is the configuration file I use to reverse proxy through to a Ubiquiti Unifi container. All my certbot is handled off site so I need not consider that here. If you compare our location blocks, the issue will likely become immediately apparent, but I'll explain for clarity's sake.
What you need to look at is your Proxy Pass directive. This is of course where the magic proxying happens. I notice that you have not been including the $request_uri, so any request nginx receives for bound.example.com/testpage1
, it will send a request to the upstream apache server for bound.example.com
. Of course if you need to include a port, as I have done here 8443
, this is the place to do it also.
If you include this variable, it should resolve your problem.
The following does not answer your question, but I thought I would include it also just as some helpful information.
Also, I just want to note that I have included a resolver. The IP address 127.0.0.11 points to Docker's internal DNS resolver. Chances are you won't need to include this, however I did so myself to ensure I didn't get odd problems. Lastly, I'd just like to recommend that you look into upgrading your SSL settings, to ensure that you are safe from attacks from weaker SSL / TLS versions.
I expect that adding the variable $request_uri to your proxy pass directive is all that is required to get your site working.
QUESTION
This is my docker file:
...ANSWER
Answered 2022-Feb-08 at 11:43I fix it by enabling the GD lib, here is my Dockerfile configs:
QUESTION
I have the following php service in docker-compse.yml
...ANSWER
Answered 2022-Feb-01 at 21:45Your docker containers don't have any knowledge of the users that may or may not exist on the host machine, so unless you've built those in with their accompanying config and directory structure the only thing you're getting out of feeding docker your local UID and GID is "running the container as something other than root", which is good.
But generally you don't want to tie a docker container/image to the particular environment that it is launched from, eg: requiring a user with the same name as your local user exist within the container, plus all of its associated directories and such.
In this specific case it looks like artisan just wants to cache some config, and you can control where that lands with the environment variable:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install docker-php
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page