HTTPDUSER=$(ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1)
setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
find ./ -type d -exec chmod 755 {} \;
find ./ -type f -exec chmod 644 {} \;
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
Switch PHP version: | |
From php5.6 to php7.0 : | |
Apache: | |
- sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart | |
CLI: | |
- update-alternatives --set php /usr/bin/php7.0 | |
From php7.0 to php5.6 : | |
Apache: | |
- sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart |
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
cut from app/config/config_dev.yml and paste to app/config/config.yml | |
framework: | |
... | |
... | |
profiler: { only_exceptions: false } | |
web_profiler: | |
toolbar: false | |
intercept_redirects: false | |
cut from app/config/routing_dev.php and paste to app/config/routing.php |
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
export SYMFONY_ENV=prod | |
composer install --no-dev --optimize-autoloader |
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
HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` | |
find ./ -type d -exec chmod 755 {} \; | |
find ./ -type f -exec chmod 644 {} \; | |
# if this doesn't work, try adding `-n` option | |
setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs | |
setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs | |
export SYMFONY_ENV=prod | |
composer install --no-dev --optimize-autoloader | |
--------------------------------------------------------------------------------------------------------------------------------- | |
chmod help: |
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
dd if=/dev/zero of=/media/fasthdd/swapfile.img bs=1024 count=10M | |
Mkswap ~/swapfile.img | |
add swap line to ======> etc/fstab | |
swapon ~/swapfile.img |
$ sudo add-apt-repository ppa:ondrej/php
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
*********************************************************** | |
* * | |
* Usefull comand * | |
* * | |
*********************************************************** | |
php -i | grep php.ini | |
In ERROR 2002 (HY000): | |
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock | |
service mysql start or service mysql start |
NewerOlder