universe

Universe
git clone https://git.dasho.dev/universe.git
Log | Files | Refs | Submodules | README

php-fpm-start.sh (864B)


      1 #!/bin/bash
      2 set -e
      3 
      4 echo "Setting up PHP-FPM permissions..."
      5 
      6 # Ensure web directory permissions
      7 echo "Fixing web directory permissions..."
      8 chown -R www-data:www-data /var/www/html
      9 find /var/www/html -type d -exec chmod 755 {} \;
     10 find /var/www/html -type f -exec chmod 644 {} \;
     11 
     12 # Ensure SQLite directory permissions
     13 if [ -d /var/lib/sqlite ]; then
     14    echo "Fixing SQLite directory permissions..."
     15    chown -R www-data:www-data /var/lib/sqlite
     16    chmod 755 /var/lib/sqlite
     17    find /var/lib/sqlite -name "*.sqlite*" -exec chmod 664 {} \; 2>/dev/null || true
     18 fi
     19 
     20 # Make PHP files executable if needed
     21 find /var/www/html -name "*.php" -exec chmod 644 {} \;
     22 
     23 # Ensure log directories are writable
     24 if [ -d /var/log/php ]; then
     25    chown -R www-data:www-data /var/log/php
     26    chmod 755 /var/log/php
     27 fi
     28 
     29 echo "Starting PHP-FPM..."
     30 exec docker-php-entrypoint php-fpm