Hi everyone, I’m having trouble installing a LAMP server for web development localy on my machine. I know that there are guides in the forum, but nothing so far to setup proper permissions and getting access to files to easily modify php, html etc and be able to see the changes at localhost/ in the browser.
I’ve installed apache php (no mariadb because i don’t use it).
Help anyone ?
And is there any use doing it through containers such as podman or docker ?If so, anyone to help guide through setup ?
create in home directory and cd mkdir ~/www/project1/
create sub-dir in “project1” : ./www and ./sql (./www is the http project root)
create one docker-compose file config docker-compose.yml in “project1” (sometime create also a custom dockerfile)
version: '3'
services:
web:
image: webdevops/php-apache:7.2
#doc config at https://dockerfile.readthedocs.io/en/latest/content/DockerImages/dockerfiles/php-apache.html#
# or if i use my dockerfile, replace "image" line by whereis my dockerfile:
#build: ./mydocker/.
ports:
- "80:80"
volumes:
# mount my home "./www" dir in docker contener
- ./www:/app
environment:
PHP_MEMORY_LIMIT: 940M
PHP_DISPLAY_ERRORS: 0
PHP_MAX_EXECUTION_TIME: 600
APPLICATION_GID: 1000
links:
- sql9:sql9
sql9:
image: mysql:5.5
volumes:
# mount my home "./sql" dir in docker contener
- ./sql:/var/lib/mysql
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=manjaro_bb
myadmin:
image: phpmyadmin/phpmyadmin
ports:
- "8080:80"
links:
- sql9:sql9
environment:
- PMA_HOST=sql9
- PMA_USER=root
- PMA_PASSWORD=root
run server : docker-compose up
only first run is long : download images (linux+apache+mysql)
one docker-compose.yml by project and all projects at localhost in manjaro host as phpmyadmin(here port 8080) and mysql cli (mysql -h127.0.0.1 -P 3306 -D manjaro_mydb -u root -p)
APPLICATION_GID: 1000 so if our id is the same : no permission problem