Toolbox for learning php.
It contains docker files and bash scripts to install and configure php server and mysql server.
- docker
-
create if is needed a folder for your php/html source file. Example:
mkdir /home/lumy/php-sources
-
clone repo:
git clone https://github.com/ovidiumiron/php-toolbox.git
-
copy the content of the
srcfolder to the new created directory:cd php-toolbox cp src/* /home/lumy/php-sources
-
set-up php:
cd php ./build.toolbox-php.sh -
start php. Please, note that the command uses the php/html source file created at the first step:
./start.sh /home/lumy/php-sources
-
change to mysql directory:
cd ../mysql -
start mysql:
./start.sh
Note:
- the IP of the mysql server is the output of the command
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' toolbox-mysql- the password for the
rootis1234
- Get the IP of the mysql server:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' toolbox-mysql - set the right IP for the mysql server by modifing the variable
$servername = "172.17.0.4";fromtest-instalation.htmllocated in the php/html source file created at the first step:
Click here to test the instalation. You should see
PHP server instalation was succesful.
Connection to mysql succesful.
Happy coding!
To connect to mysql server cli use the script console.sh from mysql folder. The script is connecting to mysql server as root. The password for root is 1234.
- php:
cd php ./teardown.sh - mysql:
cd mysql ./teardown.sh
Let say you have restarted the machine. In this case the docker containers should be started again:
- mysql:
docker start toolbox-mysql
- php:
docker start toolbox-php
If you run:
docker ps you should see both containers active.
TODO: