-
-
Save denlukasdev/3fd6d26566f0c5e8b62220b8bd7349ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ______________________________________________________________________________________________________________________________ | |
| PHP | |
| sudo apt update | |
| sudo apt -y install software-properties-common | |
| sudo add-apt-repository ppa:ondrej/php -y | |
| sudo apt update | |
| sudo apt -y install php7.4 php7.4-fpm php7.4-common php7.4-curl php7.4-cli php7.4-mysql php7.4-gd php7.4-xml php7.4-json php7.4-intl php-pear php7.4-dev php7.4-common php7.4-mbstring php7.4-zip php7.4-soap php7.4-bcmath php7.4-opcache | |
| sudo apt -y install php7.3 php7.3-fpm php7.3-common php7.3-curl php7.3-cli php7.3-mysql php7.3-gd php7.3-xml php7.3-json php7.3-intl php-pear php7.3-dev php7.3-common php7.3-mbstring php7.3-zip php7.3-soap php7.3-bcmath php7.3-opcache | |
| Chenge PHP version for CLI: | |
| sudo update-alternatives --config php | |
| sudo update-alternatives --config phar | |
| sudo update-alternatives --config phar.phar | |
| ______________________________________________________________________________________________________________________________ | |
| Apache2 | |
| sudo apt install apache2 | |
| systemctl status apache2 | |
| sudo a2enmod rewrite | |
| systemctl restart apache2 | |
| Config example: | |
| <VirtualHost *:80> | |
| DocumentRoot /var/www/magento2 | |
| ServerName local.magento2.com | |
| <Directory /var/www/magento2> | |
| AllowOverride all | |
| </Directory> | |
| </VirtualHost> | |
| Chenge PHP version for Apache2: | |
| a2dismod php7.4 | |
| a2enmod php7.3 | |
| systemctl restart apache2 | |
| a2dismod php7.3 | |
| a2enmod php7.4 | |
| systemctl restart apache2 | |
| sudo apt install php libapache2-mod-php7.4 | |
| ______________________________________________________________________________________________________________________________ | |
| Composer | |
| sudo apt install -y curl | |
| sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer --version=1.10.16 | |
| composer -v | |
| _______________________________________________________________________________________________________________________________ | |
| xDebug | |
| git clone git://github.com/xdebug/xdebug.git | |
| cd xdebug/ | |
| git checkout xdebug_2_9 | |
| sudo phpize | |
| ./configure --enable-xdebug | |
| sudo make install | |
| sudo phpenmod xdebug | |
| echo 'zend_extension=xdebug.so | |
| xdebug.idekey ="PHPSTORM" | |
| xdebug.remote_enable=1 | |
| xdebug.remote_host="127.0.0.1" | |
| xdebug.remote_port=9001 | |
| xdebug.remote_autostart=1 | |
| xdebug.remote_handler="dbgp" | |
| xdebug.remote_mode="req" | |
| xdebug.remote_connect_back=0 | |
| xdebug.max_nesting_level = 1000' > /etc/php/7.4/mods-available/xdebug.ini | |
| echo 'zend_extension=xdebug.so | |
| xdebug.idekey ="PHPSTORM" | |
| xdebug.remote_enable=1 | |
| xdebug.remote_host="127.0.0.1" | |
| xdebug.remote_port=9001 | |
| xdebug.remote_autostart=1 | |
| xdebug.remote_handler="dbgp" | |
| xdebug.remote_mode="req" | |
| xdebug.remote_connect_back=0 | |
| xdebug.max_nesting_level = 1000' > /etc/php/7.3/mods-available/xdebug.ini | |
| sudo phpenmod xdebug | |
| systemctl restart apache2 | |
| ______________________________________________________________________________________________________________________________ | |
| Mysql | |
| sudo apt install mariadb-server mariadb-client -y | |
| mysql_secure_installation | |
| Enter current password for root (enter for none): Enter | |
| Switch to unix_socket authentication [Y/n] Y | |
| Set root password? [Y/n]: Y | |
| New password: Type your password | |
| Re-enter new password: Type your password | |
| Remove anonymous users? [Y/n]: Y | |
| Disallow root login remotely? [Y/n]: Y | |
| Remove test database and access to it? [Y/n]: Y | |
| Reload privilege tables now? [Y/n]: Y | |
| CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; | |
| GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost'; | |
| FLUSH PRIVILEGES; | |
| ______________________________________________________________________________________________________________________________ | |
| Magento 2 install | |
| composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition . | |
| If you need sample data: | |
| sudo bin/magento sampledata:deploy | |
| Public Key: 34fc783b311e4e320c28333c0e196f77 | |
| Private Key: 21aa8df37dc9d66e09a076c25ab6c162 | |
| bin/magento setup:install --base-url="http://magento.loc/" --db-host="localhost" --db-name="magento" --db-user="db_user" --db-password="db_password" --db-prefix="" --admin-firstname="admin" --admin-lastname="admin" --admin-email="user@example.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" | |
| bin/magento setup:install --base-url="http://datatrans.loc:8055/" --db-host="mysql_datatrans" --db-name="datatrans" --db-user="magadb" --db-password="3579" --db-prefix="" --elasticsearch-host="elasticsearch_datatrans" --admin-firstname="admin" --admin-lastname="admin" --admin-email="user@example.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" | |
| bin/magento module:disable Magento_TwoFactorAuth | |
| php bin/magento deploy:mode:set developer | |
| php bin/magento setup:upgrade | |
| Highlighting in xml: | |
| bin/magento dev:urn-catalog:generate .idea/misc.xml | |
| Create new admin user: | |
| bin/magento admin:user:create --admin-user=user --admin-password=Pass --admin-email=yamasimka83@gmail.com --admin-firstname=Admin --admin-lastname=Admin | |
| Don't forgeat: | |
| php bin/magento c:c | |
| sudo chmod -R 777 . | |
| ________________________________________________________________________________________________________________________________ | |
| PHPSTORM excleded dir | |
| /bin/ | |
| /dev/ | |
| /pub/ | |
| /setup/ | |
| /var/cache/ | |
| /var/log/ | |
| /var/page_cache | |
| /var/view_processed | |
| _______________________________________________________________________________________________________________________________ | |
| Nginx | |
| # Example configuration: | |
| upstream fastcgi_backend { | |
| # use tcp connection | |
| # server 127.0.0.1:9000; | |
| # or socket | |
| server unix:/var/run/php/php7.3-fpm.sock; | |
| } | |
| server { | |
| listen 80; | |
| server_name magento2.loc; | |
| set $MAGE_ROOT /home/lukas/magento2; | |
| set $MAGE_DEBUG_SHOW_ARGS 1; | |
| include /home/lukas/test1/nginx.conf.sample; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment