Skip to content

Toolbox for learning php. It contains docker files and bash scripts to install and configure php server and mysql server.

Notifications You must be signed in to change notification settings

ovidiumiron/php-toolbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

php-toolbox

Toolbox for learning php.

It contains docker files and bash scripts to install and configure php server and mysql server.

Prerequisite:

  1. docker

Set-up the toolbox:

  1. create if is needed a folder for your php/html source file. Example:

    mkdir /home/lumy/php-sources
  2. clone repo:

    git clone https://github.com/ovidiumiron/php-toolbox.git 
  3. copy the content of the src folder to the new created directory:

    cd php-toolbox
    cp src/* /home/lumy/php-sources
  4. set-up php:

    cd php
    ./build.toolbox-php.sh
  5. start php. Please, note that the command uses the php/html source file created at the first step:

    ./start.sh  /home/lumy/php-sources
  6. change to mysql directory:

    cd ../mysql
  7. 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 root is 1234

Test the enviroment:

  1. Get the IP of the mysql server:
    docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' toolbox-mysql
  2. set the right IP for the mysql server by modifing the variable $servername = "172.17.0.4"; from test-instalation.html located 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!

Use mysql-cli:

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.

Remove all installed files:

  1. php:
    cd php
    ./teardown.sh
  2. mysql:
    cd mysql
    ./teardown.sh

How to start the services:

Let say you have restarted the machine. In this case the docker containers should be started again:

  1. mysql:
    docker start toolbox-mysql
  2. php:
    docker start toolbox-php

If you run:

docker ps 

you should see both containers active.

Troubleshooting:

TODO:

About

Toolbox for learning php. It contains docker files and bash scripts to install and configure php server and mysql server.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published