Comments (6)
+1
from php.
Unfortunately, I'm not actually able to reproduce: 😅
$ echo '<?php echo "foo\n";' > index.php
$ docker run -dit --name foo --mount type=bind,src="$PWD",dst=/var/www/html,ro --pull=always php:apache
apache: Pulling from library/php
Digest: sha256:7852b16fb672b5ae8acc4a0e3120152fa281e40f0b182aff4a192c5537d966d9
Status: Image is up to date for php:apache
c9457e39dbb3f6e264ca841ceb6a7e209fc74726769da462a2cbdc301899a6a9
$ docker exec foo curl -fsSL localhost
foo
$ echo '<?php echo "bar\n";' > index.php
$ docker exec foo curl -fsSL localhost
bar
Perhaps you've got some over-aggressive cache enabled? (PHP's own opcache
, perhaps?)
(Edit: updated with the command I used to change index.php
😭)
from php.
@tianon
Can you find my Dockerfile
FROM php:8.1.24-apache
# Update and install dependencies
RUN apt-get update && apt-get --no-install-recommends install -y \
apache2-utils \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev
COPY ./php.ini /usr/local/etc/php/php.ini
RUN a2enmod vhost_alias mpm_prefork rewrite php alias autoindex
docker-compose.yml
version: '3'
services:
docker:
image: docker_httpd
ports:
- 80:80
volumes:
- /app:/app
- ./apache2.conf:/etc/apache2/apache2.conf
- ./httpd-vhosts.conf:/etc/apache2/sites-enabled/httpd-vhosts.conf
/app had my PHP code,
can try with PHP projects, have multiple files like Yii or Laravel app?
I disabled opcache on php
Any suggest?
from php.
Doing a2enmod
on php
is definitely odd, but not likely to cause the problem you've described.
Without more details about your php.ini
and your Apache configuration, it's really hard to say though, because those are definitely going to be what's at fault for overaggressive cache here.
Maybe you could work to create a more minimal reproducer? (Remove bits from your custom php.ini
, remove bits from your custom Apache config, etc until the problem no longer reproduces.)
from php.
@tianon
Thank you for your reponse
The issue was fixed by disabling opcache ext on php.ini
opcache.enable=0
and i move php.ini to docker compose instead of docker file and it was working fine.
Thank you
from php.
Excellent, glad you got it figured out!
from php.
Related Issues (20)
- PHP 8.3.1 not available HOT 1
- Possibility to use additional flags in configure HOT 1
- Accessing apache files HOT 1
- [php:8.3-apache] apt-get update is not working anymore (GPG error) HOT 1
- [php:8.3-apache] HIGH Vulnerability on apache <=2.4.57 HOT 4
- curl error on php:8.2-apache (bookworm) HOT 1
- Add Support for shmop HOT 1
- Remove archive php.tar.xz from final images HOT 1
- php8.2.15 removed ftp extension HOT 12
- Connectivity issue after php:8.0-fpm HOT 13
- Error during build prod.Dockerfile
- Configuring PHP directives without custom images HOT 5
- Can't install php7.4-sybase package on php:7.4-apache-bullseye HOT 3
- iconv ASCII//TRANSLIT invalid argument HOT 2
- Php
- Add mlocati/docker-php-extension-installer to base image HOT 1
- Update apache 2.4.57-2 to 2.4.58-1 HOT 4
- ext-sockets won't compile in official Docker image 8.3.3-fpm-alpine3.19 HOT 2
- Interpreter does not resolve builtin functions when provide nonexistente file to opcache.preload option HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php.