Note about Magento¶
-
Example:
- Bash script install magento 1, 2
- File database export mysql
-
Work in site online
- Permission:
trước khi work em nên check mode php bin/magento deploy:mode:show thường cài xong sẽ để default nên chuyển qua developer php bin/magento deploy:mode:set developer để e sửa code em không phải chạy lệnh compile lại vừa rồi site bị chuyển qua mode production nếu chuyển qua mà em chạy setup upgrade thì e p chạy thêm deploy content nữa site khách thì để bảo đảm về mặt security thì e chỉ cần dùng 755 thôi
- Trước khi làm kiểm tra xem site của khách hàng có bị chết không? Sau khi mình cài, lỗi phát hiện là trước hay sau khi mình cài vào site khách.
- Chạy các lệnh của Magento:
# remove code of Old test Extension rm -rf app/code/test/* # upload code of new test Extension
# view deploy mode php bin/magento deploy:mode:show
# set deploy mode is developer and set permission before process php bin/magento deploy:mode:set developer find app/code lib var pub/static pub/media vendor -type d -exec chmod 775 {} \; find app/code lib var pub/static pub/media vendor -type f -exec chmod 664 {} \; find app/code lib var pub/static pub/media vendor app/etc \( -type d -or -type f \) -exec chmod g+w {} + && chmod o+rwx app/etc/env.php
# process implement, upload my extension php bin/magento s:upgrade php bin/magento s:di:compile php bin/magento indexer:reindex php bin/magento c:c
# set back deploy mode production and set back permission php bin/magento deploy:mode:set production --skip-compilation php bin/magento s:static-content:deploy find app/code lib var pub/static pub/media vendor -type d -exec chmod 755 {} \; find app/code lib var pub/static pub/media vendor -type f -exec chmod 644 {} \; find app/code lib var pub/static pub/media vendor app/etc \( -type d -or -type f \) -exec chmod g-w {} + && chmod o-rwx app/etc/env.php
- Chạy các lệnh của Magento:
-
Config permission for folder and file in root magento dir
(Faster)
orfind . -type f -print0 | xargs -I % -0 chmod 644 % find . -type d -print0 | xargs -I % -0 chmod 755 %
find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \;
- Permission:
-
Debug
var_dump($item->debug()); die();
-
Reload config php.ini by some ways:
- Reload server:
sudo service apache2 restart
- Reload Php
apachectl graceful
- Reload server:
-
Detail about it, you can see here