normal if PHP, is installed on the system, if you want to run a php script directly, php a.php
can see the result.
how do I execute an a.php script if I use a docker build image?
normal if PHP, is installed on the system, if you want to run a php script directly, php a.php
can see the result.
how do I execute an a.php script if I use a docker build image?
first do a directory mapping, map the directory where a.php is located to the inside of the container, and then execute it with cli inside the container
ssh-l loginname host-P port php a.php
for example, it is native. The port number is 8000
, and the user name is admin
ssh -l admin localhost -P 8000 a.php
docker run-- rm-it-v / (directory where a.php is located): / tmp php-docker (your docker image) sh-c "php / tmp/a.php"
-- rm single run container
if your php container is already running, exec it internally, or
docker exec-it container ID sh-c "php / (your mount directory) / a.php"
docker has a VOLUME
that mounts the host directory, which you can set up.
Previous: Git clone error RPC failed
Next: Are there any good public cloud services in blockchain? Ability to support smart contracts
in order to facilitate development, we plan to create a LNMP environment based on docker, which makes it much more convenient to change computers or unify the team s development environment. choreographed a docker-compose.yaml file with nginx, php-fp...
my docker for windows, runs on gitbash: docker D what should be done ...
recently I wanted to run laravel, with docker, so I searched docker hub and found this image . so I only share app and public according to the document given by him. There is no exception in external access, but I will report an error about missing p...
I ve just read some introductory articles on docker, but I m still not sure whether it s appropriate to use docker to deploy a PHP project. For example, it is obviously inappropriate to package a project into a container as a virtual machine, and the ...
when there is no local php environment, I want to access the port number of the docker map through vscode and debug the code remotely. X-debug in vscode has been configured in map,docker, xdebug has been configured in remote_host, but still cannot break...
the CCS swarm of Aliyun is used for service discovery. A single host with 4 cores of 16GB memory use alpine to write a php runtime environment for apache. The (dockerfile), program is based on the laravel framework . I wonder if the performance of fl...
how does alpine:3.7 install the php extension in docker? Environment needs php5.6+nginx found that there is no mbstring extension below php7, and there is no such extension in alpine repository. How can I install it in docker? Look forward to God s ad...
docker is installed in the win10 environment. What if laradock, kills the docker process and restarts today and finds that the database is gone? ...
one thing I don t understand when using docker: is there any difference between pull a mysql from an official image and then run it on my machine? is there any difference between using Dockerfile to first pull a centos image and then installing a mysql...
I, a docker running nginx and a docker running php7.2 I ran the swoole websocket service in php72 docker. I can work through 127.0.0.1 br 9501 but when I configure proxy 9501 in nginx.conf, as long as I am a proxy nginx, I will hang up whether I am a p...
after executing this command, you can open an extension, but I don t quite understand what this principle is. I wish I couldn t find the line that opened the extension in the php.ini configuration file. I hope seniors can explain this. ...