Setting permission in laravel deployment on linux.

Setting permission in laravel deployment on linux.

git clone as sudo?

Change ownership of your Laravel project to your user

sudo chown -R crm:crm /var/www/html/lms

Set proper permissions

chmod -R 755 /var/www/html/lms

crm@crmdb:/var/www/html$ sudo git clone https://yourAccessToken@github.com/mmsoftware100/learning-platform-laravel lms
Cloning into 'lms'...
remote: Enumerating objects: 800, done.
remote: Counting objects: 100% (800/800), done.
remote: Compressing objects: 100% (464/464), done.
remote: Total 800 (delta 405), reused 665 (delta 270), pack-reused 0 (from 0)
Receiving objects: 100% (800/800), 1.71 MiB | 10.09 MiB/s, done.
Resolving deltas: 100% (405/405), done.
crm@crmdb:/var/www/html$ cd lms
crm@crmdb:/var/www/html/lms$ composer install
Command 'composer' not found, but can be installed with:
sudo apt install composer
crm@crmdb:/var/www/html/lms$ sudo apt install composer
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  jsonlint libzip4t64 php-composer-ca-bundle php-composer-class-map-generator php-composer-metadata-minifier php-composer-pcre php-composer-semver
  php-composer-spdx-licenses php-composer-xdebug-handler php-curl php-intl php-json-schema php-mbstring php-psr-container php-psr-log php-react-promise
  php-seld-signal-handler php-symfony-console php-symfony-deprecation-contracts php-symfony-filesystem php-symfony-finder php-symfony-process
  php-symfony-service-contracts php-symfony-string php-zip php8.3-curl php8.3-intl php8.3-mbstring php8.3-zip unzip
Suggested packages:
  fossil mercurial subversion zip
The following NEW packages will be installed:
  composer jsonlint libzip4t64 php-composer-ca-bundle php-composer-class-map-generator php-composer-metadata-minifier php-composer-pcre php-composer-semver
  php-composer-spdx-licenses php-composer-xdebug-handler php-curl php-intl php-json-schema php-mbstring php-psr-container php-psr-log php-react-promise
  php-seld-signal-handler php-symfony-console php-symfony-deprecation-contracts php-symfony-filesystem php-symfony-finder php-symfony-process
  php-symfony-service-contracts php-symfony-string php-zip php8.3-curl php8.3-intl php8.3-mbstring php8.3-zip unzip
0 upgraded, 31 newly installed, 0 to remove and 93 not upgraded.
Need to get 1,874 kB of archives.
After this operation, 7,805 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-composer-ca-bundle all 1.4.1-1 [11.1 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-symfony-finder all 6.4.5+dfsg-3ubuntu3 [32.0 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-composer-pcre all 3.1.1-1 [10.2 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-composer-class-map-generator all 1.1.0-2 [10.5 kB]
Get:5 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-composer-metadata-minifier all 1.0.0-2 [3,594 B]
Get:6 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-composer-semver all 3.4.0-1 [19.2 kB]
Get:7 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-composer-spdx-licenses all 1.5.8-1 [15.4 kB]
Get:8 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-psr-log all 3.0.0-1 [6,862 B]
Get:9 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-composer-xdebug-handler all 3.0.3-3 [16.6 kB]
Get:10 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-json-schema all 5.2.13-1 [33.8 kB]
Get:11 http://archive.ubuntu.com/ubuntu noble/universe amd64 jsonlint all 1.10.2-1 [13.7 kB]
Get:12 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-symfony-deprecation-contracts all 3.4.1-4 [5,668 B]
Get:13 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 php8.3-mbstring amd64 8.3.6-0ubuntu0.24.04.5 [512 kB]
Get:14 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-mbstring all 2:8.3+93ubuntu2 [1,848 B]
Get:15 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-psr-container all 2.0.2-1 [3,878 B]
Get:16 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-symfony-service-contracts all 3.4.1-4 [10.0 kB]
Get:17 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 php8.3-intl amd64 8.3.6-0ubuntu0.24.04.5 [156 kB]
Get:18 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-intl all 2:8.3+93ubuntu2 [1,846 B]
Get:19 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-symfony-string all 6.4.5+dfsg-3ubuntu3 [44.0 kB]
Get:20 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-symfony-console all 6.4.5+dfsg-3ubuntu3 [96.7 kB]
Get:21 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-symfony-filesystem all 6.4.5+dfsg-3ubuntu3 [30.7 kB]
Get:22 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-symfony-process all 6.4.5+dfsg-3ubuntu3 [37.4 kB]
Get:23 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-react-promise all 3.1.0-1 [18.5 kB]
Get:24 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-seld-signal-handler all 2.0.2-1 [10.0 kB]
Get:25 http://archive.ubuntu.com/ubuntu noble/universe amd64 composer all 2.7.1-2 [471 kB]
Get:26 http://archive.ubuntu.com/ubuntu noble/universe amd64 libzip4t64 amd64 1.7.3-1.1ubuntu2 [53.6 kB]
Get:27 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 php8.3-curl amd64 8.3.6-0ubuntu0.24.04.5 [40.3 kB]
Get:28 http://archive.ubuntu.com/ubuntu noble/main amd64 php-curl all 2:8.3+93ubuntu2 [1,836 B]
Get:29 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 php8.3-zip amd64 8.3.6-0ubuntu0.24.04.5 [29.5 kB]
Get:30 http://archive.ubuntu.com/ubuntu noble/universe amd64 php-zip all 2:8.3+93ubuntu2 [1,832 B]
Get:31 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 unzip amd64 6.0-28ubuntu4.1 [174 kB]
Fetched 1,874 kB in 4s (432 kB/s)
Extracting templates from packages: 100%
Selecting previously unselected package php-composer-ca-bundle.
(Reading database ... 126387 files and directories currently installed.)
Preparing to unpack .../00-php-composer-ca-bundle_1.4.1-1_all.deb ...
Unpacking php-composer-ca-bundle (1.4.1-1) ...
Selecting previously unselected package php-symfony-finder.
Preparing to unpack .../01-php-symfony-finder_6.4.5+dfsg-3ubuntu3_all.deb ...
Unpacking php-symfony-finder (6.4.5+dfsg-3ubuntu3) ...
Selecting previously unselected package php-composer-pcre.
Preparing to unpack .../02-php-composer-pcre_3.1.1-1_all.deb ...
Unpacking php-composer-pcre (3.1.1-1) ...
Selecting previously unselected package php-composer-class-map-generator.
Preparing to unpack .../03-php-composer-class-map-generator_1.1.0-2_all.deb ...
Unpacking php-composer-class-map-generator (1.1.0-2) ...
Selecting previously unselected package php-composer-metadata-minifier.
Preparing to unpack .../04-php-composer-metadata-minifier_1.0.0-2_all.deb ...
Unpacking php-composer-metadata-minifier (1.0.0-2) ...
Selecting previously unselected package php-composer-semver.
Preparing to unpack .../05-php-composer-semver_3.4.0-1_all.deb ...
Unpacking php-composer-semver (3.4.0-1) ...
Selecting previously unselected package php-composer-spdx-licenses.
Preparing to unpack .../06-php-composer-spdx-licenses_1.5.8-1_all.deb ...
Unpacking php-composer-spdx-licenses (1.5.8-1) ...
Selecting previously unselected package php-psr-log.
Preparing to unpack .../07-php-psr-log_3.0.0-1_all.deb ...
Unpacking php-psr-log (3.0.0-1) ...
Selecting previously unselected package php-composer-xdebug-handler.
Preparing to unpack .../08-php-composer-xdebug-handler_3.0.3-3_all.deb ...
Unpacking php-composer-xdebug-handler (3.0.3-3) ...
Selecting previously unselected package php-json-schema.
Preparing to unpack .../09-php-json-schema_5.2.13-1_all.deb ...
Unpacking php-json-schema (5.2.13-1) ...
Selecting previously unselected package jsonlint.
Preparing to unpack .../10-jsonlint_1.10.2-1_all.deb ...
Unpacking jsonlint (1.10.2-1) ...
Selecting previously unselected package php-symfony-deprecation-contracts.
Preparing to unpack .../11-php-symfony-deprecation-contracts_3.4.1-4_all.deb ...
Unpacking php-symfony-deprecation-contracts (3.4.1-4) ...
Selecting previously unselected package php8.3-mbstring.
Preparing to unpack .../12-php8.3-mbstring_8.3.6-0ubuntu0.24.04.5_amd64.deb ...
Unpacking php8.3-mbstring (8.3.6-0ubuntu0.24.04.5) ...
Selecting previously unselected package php-mbstring.
Preparing to unpack .../13-php-mbstring_2%3a8.3+93ubuntu2_all.deb ...
Unpacking php-mbstring (2:8.3+93ubuntu2) ...
Selecting previously unselected package php-psr-container.
Preparing to unpack .../14-php-psr-container_2.0.2-1_all.deb ...
Unpacking php-psr-container (2.0.2-1) ...
Selecting previously unselected package php-symfony-service-contracts.
Preparing to unpack .../15-php-symfony-service-contracts_3.4.1-4_all.deb ...
Unpacking php-symfony-service-contracts (3.4.1-4) ...
Selecting previously unselected package php8.3-intl.
Preparing to unpack .../16-php8.3-intl_8.3.6-0ubuntu0.24.04.5_amd64.deb ...
Unpacking php8.3-intl (8.3.6-0ubuntu0.24.04.5) ...
Selecting previously unselected package php-intl.
Preparing to unpack .../17-php-intl_2%3a8.3+93ubuntu2_all.deb ...
Unpacking php-intl (2:8.3+93ubuntu2) ...
Selecting previously unselected package php-symfony-string.
Preparing to unpack .../18-php-symfony-string_6.4.5+dfsg-3ubuntu3_all.deb ...
Unpacking php-symfony-string (6.4.5+dfsg-3ubuntu3) ...
Selecting previously unselected package php-symfony-console.
Preparing to unpack .../19-php-symfony-console_6.4.5+dfsg-3ubuntu3_all.deb ...
Unpacking php-symfony-console (6.4.5+dfsg-3ubuntu3) ...
Selecting previously unselected package php-symfony-filesystem.
Preparing to unpack .../20-php-symfony-filesystem_6.4.5+dfsg-3ubuntu3_all.deb ...
Unpacking php-symfony-filesystem (6.4.5+dfsg-3ubuntu3) ...
Selecting previously unselected package php-symfony-process.
Preparing to unpack .../21-php-symfony-process_6.4.5+dfsg-3ubuntu3_all.deb ...
Unpacking php-symfony-process (6.4.5+dfsg-3ubuntu3) ...
Selecting previously unselected package php-react-promise.
Preparing to unpack .../22-php-react-promise_3.1.0-1_all.deb ...
Unpacking php-react-promise (3.1.0-1) ...
Selecting previously unselected package php-seld-signal-handler.
Preparing to unpack .../23-php-seld-signal-handler_2.0.2-1_all.deb ...
Unpacking php-seld-signal-handler (2.0.2-1) ...
Selecting previously unselected package composer.
Preparing to unpack .../24-composer_2.7.1-2_all.deb ...
Unpacking composer (2.7.1-2) ...
Selecting previously unselected package libzip4t64:amd64.
Preparing to unpack .../25-libzip4t64_1.7.3-1.1ubuntu2_amd64.deb ...
Unpacking libzip4t64:amd64 (1.7.3-1.1ubuntu2) ...
Selecting previously unselected package php8.3-curl.
Preparing to unpack .../26-php8.3-curl_8.3.6-0ubuntu0.24.04.5_amd64.deb ...
Unpacking php8.3-curl (8.3.6-0ubuntu0.24.04.5) ...
Selecting previously unselected package php-curl.
Preparing to unpack .../27-php-curl_2%3a8.3+93ubuntu2_all.deb ...
Unpacking php-curl (2:8.3+93ubuntu2) ...
Selecting previously unselected package php8.3-zip.
Preparing to unpack .../28-php8.3-zip_8.3.6-0ubuntu0.24.04.5_amd64.deb ...
Unpacking php8.3-zip (8.3.6-0ubuntu0.24.04.5) ...
Selecting previously unselected package php-zip.
Preparing to unpack .../29-php-zip_2%3a8.3+93ubuntu2_all.deb ...
Unpacking php-zip (2:8.3+93ubuntu2) ...
Selecting previously unselected package unzip.
Preparing to unpack .../30-unzip_6.0-28ubuntu4.1_amd64.deb ...
Unpacking unzip (6.0-28ubuntu4.1) ...
Setting up php-symfony-finder (6.4.5+dfsg-3ubuntu3) ...
Setting up php8.3-curl (8.3.6-0ubuntu0.24.04.5) ...

Creating config file /etc/php/8.3/mods-available/curl.ini with new version
Setting up jsonlint (1.10.2-1) ...
Setting up unzip (6.0-28ubuntu4.1) ...
Setting up php-psr-container (2.0.2-1) ...
Setting up php-composer-pcre (3.1.1-1) ...
Setting up php8.3-intl (8.3.6-0ubuntu0.24.04.5) ...

Creating config file /etc/php/8.3/mods-available/intl.ini with new version
Setting up php-symfony-service-contracts (3.4.1-4) ...
Setting up php-composer-class-map-generator (1.1.0-2) ...
Setting up php-intl (2:8.3+93ubuntu2) ...
Setting up php-seld-signal-handler (2.0.2-1) ...
Setting up php-composer-ca-bundle (1.4.1-1) ...
Setting up php8.3-mbstring (8.3.6-0ubuntu0.24.04.5) ...

Creating config file /etc/php/8.3/mods-available/mbstring.ini with new version
Setting up php-symfony-process (6.4.5+dfsg-3ubuntu3) ...
Setting up php-symfony-filesystem (6.4.5+dfsg-3ubuntu3) ...
Setting up php-react-promise (3.1.0-1) ...
Setting up php-psr-log (3.0.0-1) ...
Setting up php-symfony-string (6.4.5+dfsg-3ubuntu3) ...
Setting up php-composer-metadata-minifier (1.0.0-2) ...
Setting up php-composer-semver (3.4.0-1) ...
Setting up php-json-schema (5.2.13-1) ...
Setting up php-composer-spdx-licenses (1.5.8-1) ...
Setting up libzip4t64:amd64 (1.7.3-1.1ubuntu2) ...
Setting up php-symfony-deprecation-contracts (3.4.1-4) ...
Setting up php-curl (2:8.3+93ubuntu2) ...
Setting up php-symfony-console (6.4.5+dfsg-3ubuntu3) ...
Setting up php-composer-xdebug-handler (3.0.3-3) ...
Setting up php-mbstring (2:8.3+93ubuntu2) ...
Setting up php8.3-zip (8.3.6-0ubuntu0.24.04.5) ...

Creating config file /etc/php/8.3/mods-available/zip.ini with new version
Setting up php-zip (2:8.3+93ubuntu2) ...
Setting up composer (2.7.1-2) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libapache2-mod-php8.3 (8.3.6-0ubuntu0.24.04.5) ...
Processing triggers for libc-bin (2.39-0ubuntu8.5) ...
Processing triggers for php8.3-cli (8.3.6-0ubuntu0.24.04.5) ...
Scanning processes...                                                                                                                                        
Scanning candidates...                                                                                                                                       
Scanning linux images...                                                                                                                                     

Pending kernel upgrade!
Running kernel version:
  6.8.0-71-generic
Diagnostics:
  The currently running kernel version is not the expected kernel version 6.8.0-79-generic.

Restarting the system to load the new kernel will not be handled automatically, so you should consider rebooting.

Restarting services...

Service restarts being deferred:
 systemctl restart unattended-upgrades.service

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
crm@crmdb:/var/www/html/lms$ 


crm@crmdb:/var/www/html/lms$ composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - masterminds/html5 is locked to version 2.10.0 and an update of this package was not requested.
    - masterminds/html5 2.10.0 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 2
    - openspout/openspout is locked to version v4.28.5 and an update of this package was not requested.
    - openspout/openspout v4.28.5 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 3
    - symfony/html-sanitizer is locked to version v7.3.3 and an update of this package was not requested.
    - symfony/html-sanitizer v7.3.3 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 4
    - tijsverkoyen/css-to-inline-styles is locked to version v2.3.0 and an update of this package was not requested.
    - tijsverkoyen/css-to-inline-styles v2.3.0 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 5
    - laravel/pint is locked to version v1.24.0 and an update of this package was not requested.
    - laravel/pint v1.24.0 requires ext-xml * -> it is missing from your system. Install or enable PHP's xml extension.
  Problem 6
    - phar-io/manifest is locked to version 2.0.4 and an update of this package was not requested.
    - phar-io/manifest 2.0.4 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 7
    - phpunit/php-code-coverage is locked to version 11.0.11 and an update of this package was not requested.
    - phpunit/php-code-coverage 11.0.11 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 8
    - phpunit/phpunit is locked to version 11.5.36 and an update of this package was not requested.
    - phpunit/phpunit 11.5.36 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 9
    - sebastian/comparator is locked to version 6.3.2 and an update of this package was not requested.
    - sebastian/comparator 6.3.2 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 10
    - theseer/tokenizer is locked to version 1.2.3 and an update of this package was not requested.
    - theseer/tokenizer 1.2.3 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 11
    - tijsverkoyen/css-to-inline-styles v2.3.0 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
    - laravel/framework v12.28.1 requires tijsverkoyen/css-to-inline-styles ^2.2.5 -> satisfiable by tijsverkoyen/css-to-inline-styles[v2.3.0].
    - laravel/framework is locked to version v12.28.1 and an update of this package was not requested.

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/8.3/cli/php.ini
    - /etc/php/8.3/cli/conf.d/10-mysqlnd.ini
    - /etc/php/8.3/cli/conf.d/10-opcache.ini
    - /etc/php/8.3/cli/conf.d/10-pdo.ini
    - /etc/php/8.3/cli/conf.d/20-calendar.ini
    - /etc/php/8.3/cli/conf.d/20-ctype.ini
    - /etc/php/8.3/cli/conf.d/20-curl.ini
    - /etc/php/8.3/cli/conf.d/20-exif.ini
    - /etc/php/8.3/cli/conf.d/20-ffi.ini
    - /etc/php/8.3/cli/conf.d/20-fileinfo.ini
    - /etc/php/8.3/cli/conf.d/20-ftp.ini
    - /etc/php/8.3/cli/conf.d/20-gettext.ini
    - /etc/php/8.3/cli/conf.d/20-iconv.ini
    - /etc/php/8.3/cli/conf.d/20-intl.ini
    - /etc/php/8.3/cli/conf.d/20-mbstring.ini
    - /etc/php/8.3/cli/conf.d/20-mysqli.ini
    - /etc/php/8.3/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/8.3/cli/conf.d/20-phar.ini
    - /etc/php/8.3/cli/conf.d/20-posix.ini
    - /etc/php/8.3/cli/conf.d/20-readline.ini
    - /etc/php/8.3/cli/conf.d/20-shmop.ini
    - /etc/php/8.3/cli/conf.d/20-sockets.ini
    - /etc/php/8.3/cli/conf.d/20-sysvmsg.ini
    - /etc/php/8.3/cli/conf.d/20-sysvsem.ini
    - /etc/php/8.3/cli/conf.d/20-sysvshm.ini
    - /etc/php/8.3/cli/conf.d/20-tokenizer.ini
    - /etc/php/8.3/cli/conf.d/20-zip.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-dom --ignore-platform-req=ext-xml` to temporarily ignore these required extensions.


Written on September 7, 2025