✋Welcome back to Webzone tech tips, I am Zidane! Topic today is share with you how to use DDEV, and what is DDEV? it very useful for developer just focus on coding, development, and the environment just let DDEV and do it
DDEV is an open-source tool that simplifies local web development environments using Docker. Here’s what you need to know:
1. Purpose: DDEV creates isolated development environments for PHP, Node.js, and Python (experimental). It allows you to work on multiple projects with different tech stacks and cloud servers.
2. Features:
* Fast Setup: Spin up environments in minutes.
* Multi-Platform: Works on macOS, Windows, and Linux.
* Custom Domains & SSL: Handles custom domain names and HTTPS automatically.
* App Ready Presets: Supports popular frameworks like Laravel, WordPress, Drupal, and more.
* Unlimited Projects: Run multiple projects concurrently.
* Extensible: Add-ons, lifecycle hooks, and custom Dockerfiles.
* Open Source: Licensed under Apache 2.0.
3. Usage:
* Install DDEV (follow the official documentation).
* Create a DDEV project for your web application.
* Use ddev start to launch the environment.
* Access your project via the provided URLs (e.g., my-project.ddev.site).
# Install DDEV (MACOS)
brew install ddev/ddev/ddev
#Install DDEV (Window, Linux) -> you can check here
# One-time initialization of mkcert
mkcert -install
Staring a project
1. Clone or create the code for your project.
php8 composer create-project cakephp/app cf24
π Tiktok
π Facebook:Since i have install PHP 7.4.33, 8.2.0 on the same machine, so i customize my PATH on my base profile like this.
export CLICOLOR=1
export LSCOLORS=gxfxCxDxBxegedabagaced
alias php8=/Applications/MAMP/bin/php/php8.2.0/bin/php
alias composer8=/Users/vihuuly/composerphp8/composer.phar
export PATH=/Applications/MAMP/bin/php/php7.4.33/bin:$PATH
export PATH=/Users/vihuuly/flutter/bin:$PATH
alias pip=/Library/Frameworks/Python.framework/Versions/3.12/bin/python3 -m pip
alias psql=/Library/PostgreSQL/16/bin/psql
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
2. cd into the project directory and run ddev config to initialize a DDEV project.
ddev config
name: cf24
type: cakephp
docroot: webroot
php_version: "8.3"
webserver_type: nginx-fpm
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
database:
type: mysql
version: "8.0"
use_dns_when_possible: true
composer_version: "2"
web_environment: []
corepack_enable: false
disable_upload_dirs_warning: true
Sepecial DDEV support CakePHP
Some basic comment
ddev start: run a docker (please note, open docker first, you can check docker topic here)
ddev restart
ddev mysql -> access mysql
ddev get --list -> show all list software available, this is useful comment
ddev get ddev/ddev-phpmyadmin, for install this plugin, (please note, use ddev restart/ ddev start to active plugin setup)
ddev auth token from Github for extense the download git (because for we use ddev get ddev-phpmyadmin: it download from github, so we need to auth to extention the time)
Click on github Profile avatar -> Settings -> Developer Settings -> Personal access tokens with Fine-grainde personal access tokens --> generate one (use for personal API use and for using Git over HTTPS)
3. Run ddev start to spin up the project.
4. Run ddev launch to open your project in a browser.