I’m just exploring Docker and containerization for a little bit and I’ve stacked with the problem in the title:
Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/index.php on line 2
Here is my Dockerfile PHP:
`RUN curl -sS https://getcomposer.org/installer | php — –install-dir=/usr/local/bin –filename=composer
COPY src/composer.json /var/www/html/
RUN composer install –no-dev -d /var/www/html/
COPY src/ /var/www/html/`
docker-compose.yaml:
php: build: context: . dockerfile: php/Dockerfile networks: - internal volumes: - ./src/:/var/www/html/ - ./logs/php.log:/var/log/fpm-php.www.log
and finally my project files:
enter image description here
I’ve tried to change both PHP dockerfile and docker-compose but it doesn’t work.
Thank you in advance for your help guys.
halunkatheking is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.