{"id":1205,"date":"2026-11-29T18:00:00","date_gmt":"2026-11-29T18:00:00","guid":{"rendered":"https:\/\/vpslake.com\/blog\/?p=1205"},"modified":"2026-11-29T18:00:00","modified_gmt":"2026-11-29T18:00:00","slug":"install-laravel-php-framework-almalinux-9","status":"publish","type":"post","link":"https:\/\/vpslake.com\/blog\/2026\/11\/29\/install-laravel-php-framework-almalinux-9\/","title":{"rendered":"How to Install Laravel PHP Framework on AlmaLinux 9"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Install Laravel PHP framework on AlmaLinux 9 in about 20 minutes and finish with a Laravel 13 application behind Apache and PHP-FPM. You will create a separate MariaDB account, keep SELinux enforcing, and expose only the web ports the application needs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">AlmaLinux 9.6 and later provide PHP 8.3 through AppStream, which meets Laravel 13&#8217;s minimum requirement. The procedure below uses that native module stream, Composer&#8217;s verified installer, and a real virtual host instead of Laravel&#8217;s development server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>A 64-bit AlmaLinux 9.6 or later VPS with at least 2 GB of RAM and 15 GB of free disk space.<\/li>\n\n\n<li>SSH access as <code>root<\/code>, or a non-root account with working <code>sudo<\/code> privileges and outbound HTTPS access.<\/li>\n\n\n<li>A public IPv4 address. A DNS name is optional for the first local HTTP check but required for a trusted certificate.<\/li>\n\n\n<li>A <a href=\"https:\/\/vpslake.com\/buy-vps\">VPSLake Linux VPS<\/a> if you need an AlmaLinux server with root access.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The commands use <code>sudo<\/code> for a regular account. If you are already <code>root<\/code>, omit <code>sudo<\/code>. Replace uppercase placeholders before running a command; the database password must be long and unique.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Confirm AlmaLinux 9 and install the server stack<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Confirming the release prevents an EL8 or EL10 PHP instruction from being mixed into this installation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -E '^(PRETTY_NAME|VERSION_ID|PLATFORM_ID)=' \/etc\/os-release\nuname -m\nsudo dnf upgrade -y\nsudo dnf install -y epel-release firewalld httpd mariadb-server curl git unzip policycoreutils-python-utils\nsudo dnf module reset php -y\nsudo dnf module install php:8.3\/common -y\nsudo dnf install -y php-mysqlnd php-mbstring php-xml php-bcmath php-curl php-gd php-opcache php-pecl-zip\nsudo systemctl enable --now firewalld httpd php-fpm mariadb\nphp -v\nsudo systemctl is-active firewalld httpd php-fpm mariadb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The release should show AlmaLinux 9, the architecture should normally be <code>x86_64<\/code>, and PHP should begin with 8.3. Each service check should print <code>active<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PRETTY_NAME=\"AlmaLinux 9.x (Seafoam Ocelot)\"\nVERSION_ID=\"9.x\"\nx86_64\nPHP 8.3.x (cli) ...\nactive\nactive\nactive\nactive<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>common<\/code> PHP profile includes PHP-FPM for Apache. The extra packages add the database driver and Laravel&#8217;s common extensions without relying on a third-party PHP repository.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Install Composer and verify its installer<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Composer resolves Laravel&#8217;s dependency tree, and checking the published SHA-384 value avoids running a damaged installer.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/tmp\nEXPECTED_CHECKSUM=\"$(php -r 'copy(\"https:\/\/composer.github.io\/installer.sig\", \"php:\/\/stdout\");')\"\nphp -r \"copy('https:\/\/getcomposer.org\/installer', 'composer-setup.php');\"\nACTUAL_CHECKSUM=\"$(php -r \"echo hash_file('sha384', 'composer-setup.php');\")\"\nif [ \"$EXPECTED_CHECKSUM\" != \"$ACTUAL_CHECKSUM\" ]; then echo 'ERROR: Invalid Composer installer checksum'; rm -f composer-setup.php; exit 1; fi\nsudo php composer-setup.php --install-dir=\/usr\/local\/bin --filename=composer\nrm -f composer-setup.php\ncomposer --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The final line should show Composer 2.x. The <a href=\"https:\/\/getcomposer.org\/doc\/00-intro.md\" target=\"_blank\" rel=\"noopener\">Composer installation documentation<\/a> describes the global PHAR location and the checksum workflow; the exact patch number will change over time.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Composer version 2.x.x 20xx-xx-xx<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Create a MariaDB database for Laravel<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Using a dedicated account limits the damage if the application credentials are ever exposed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mariadb-secure-installation<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When prompted, remove anonymous users, reject remote root login, remove the test database, and reload the privilege tables. Keep the local administrative socket authentication unless you have a specific reason to change it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create the application database and two local account entries. The second host matches Laravel&#8217;s explicit <code>127.0.0.1<\/code> TCP connection rather than relying on socket behavior.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mariadb &lt;&lt;'SQL'\nCREATE DATABASE laravel_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\nCREATE USER 'laravel_user'@'localhost' IDENTIFIED BY 'YOUR_DB_PASSWORD';\nCREATE USER 'laravel_user'@'127.0.0.1' IDENTIFIED BY 'YOUR_DB_PASSWORD';\nGRANT ALL PRIVILEGES ON laravel_db.* TO 'laravel_user'@'localhost';\nGRANT ALL PRIVILEGES ON laravel_db.* TO 'laravel_user'@'127.0.0.1';\nFLUSH PRIVILEGES;\nSQL\nsudo mariadb -e \"SHOW DATABASES LIKE 'laravel_db';\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The check should return <code>laravel_db<\/code>. Do not add MariaDB to firewalld; the web process connects locally, so port 3306 has no reason to be public.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Database (laravel_db)\nlaravel_db<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Create the Laravel application<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Installing the project as <code>apache<\/code> keeps the Composer cache and application files usable by PHP-FPM without a later ownership sweep.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo install -d -o apache -g apache \/var\/www\/laravelapp \/usr\/share\/httpd\/.cache \/usr\/share\/httpd\/.config\nsudo -u apache -H composer create-project --no-interaction --prefer-dist laravel\/laravel:^13.0 \/var\/www\/laravelapp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This pins the new project to Laravel 13, whose minimum PHP version is 8.3. Laravel&#8217;s <a href=\"https:\/\/laravel.com\/docs\/13.x\/deployment\" target=\"_blank\" rel=\"noopener\">deployment documentation<\/a> also requires the web server to point at <code>public<\/code> and identifies <code>storage<\/code> and <code>bootstrap\/cache<\/code> as writable directories.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the generated environment file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudoedit \/var\/www\/laravelapp\/.env<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Keep the generated <code>APP_KEY<\/code> line for the next command, then set the following values. Replace <code>YOUR_DOMAIN<\/code> and <code>YOUR_DB_PASSWORD<\/code> with real values.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>APP_ENV=production\nAPP_DEBUG=false\nAPP_URL=http:\/\/YOUR_DOMAIN\nDB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_DATABASE=laravel_db\nDB_USERNAME=laravel_user\nDB_PASSWORD=YOUR_DB_PASSWORD<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Generate the encryption key and apply Laravel&#8217;s initial migrations:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo -u apache -H php \/var\/www\/laravelapp\/artisan key:generate --force\nsudo -u apache -H php \/var\/www\/laravelapp\/artisan config:clear\nsudo -u apache -H php \/var\/www\/laravelapp\/artisan migrate --force<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Migration output should end with completed migration entries. Do not run <code>db:seed<\/code> unless your own application contains seed data you actually want to load.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Configure Apache to serve Laravel<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Apache must expose only the <code>public<\/code> directory; the project root contains <code>.env<\/code>, Composer metadata, and other files that should never be downloadable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create the virtual host and replace both <code>YOUR_DOMAIN<\/code> occurrences before saving it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo tee \/etc\/httpd\/conf.d\/zz-laravel.conf &gt; \/dev\/null &lt;&lt;'APACHE'\n&lt;VirtualHost *:80&gt;\n    ServerName YOUR_DOMAIN\n    ServerAlias www.YOUR_DOMAIN\n    DocumentRoot \/var\/www\/laravelapp\/public\n    DirectoryIndex index.php\n\n    &lt;Directory \/var\/www\/laravelapp\/public&gt;\n        AllowOverride All\n        Options -Indexes +FollowSymLinks\n        Require all granted\n    &lt;\/Directory&gt;\n\n    &lt;FilesMatch \\.php$&gt;\n        SetHandler \"proxy:unix:\/run\/php-fpm\/www.sock|fcgi:\/\/localhost\"\n    &lt;\/FilesMatch&gt;\n\n    ErrorLog \/var\/log\/httpd\/laravel-error.log\n    CustomLog \/var\/log\/httpd\/laravel-access.log combined\n&lt;\/VirtualHost&gt;\nAPACHE\nsudo apachectl configtest\nsudo systemctl reload httpd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Syntax OK<\/code> means Apache accepted the file. The <code>zz-<\/code> prefix makes this site configuration load late, while the PHP-FPM socket sends PHP requests to the managed application worker.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Set SELinux-safe permissions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Laravel needs to write logs, sessions, compiled views, and caches, but the rest of the code can remain owned by <code>root<\/code> and readable by Apache&#8217;s group.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo semanage fcontext -a -t httpd_sys_rw_content_t '\/var\/www\/laravelapp\/(storage|bootstrap\/cache)(\/.*)?'\nsudo restorecon -Rv \/var\/www\/laravelapp\nsudo chown -R root:apache \/var\/www\/laravelapp\nsudo find \/var\/www\/laravelapp -type d -exec chmod 0750 {} +\nsudo find \/var\/www\/laravelapp -type f -exec chmod 0640 {} +\nsudo chown -R apache:apache \/var\/www\/laravelapp\/storage \/var\/www\/laravelapp\/bootstrap\/cache\nsudo find \/var\/www\/laravelapp\/storage \/var\/www\/laravelapp\/bootstrap\/cache -type d -exec chmod 0770 {} +\nsudo find \/var\/www\/laravelapp\/storage \/var\/www\/laravelapp\/bootstrap\/cache -type f -exec chmod 0660 {} +\nsudo setsebool -P httpd_can_network_connect_db on<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The persistent file-context rule survives relabeling, and the boolean permits the web process to reach MariaDB. Leave SELinux enforcing; making the entire project writable or disabling protection hides the actual configuration problem.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 7: Open web ports and enable HTTPS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Allow SSH before applying the web rules so a new firewalld activation does not strand your session, then publish only HTTP and HTTPS.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --zone=public --permanent --add-service=ssh\nsudo firewall-cmd --zone=public --permanent --add-service=http\nsudo firewall-cmd --zone=public --permanent --add-service=https\nsudo firewall-cmd --reload\nsudo firewall-cmd --zone=public --list-services<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When <code>YOUR_DOMAIN<\/code> resolves to the VPS, install Certbot and let it update Apache. Replace <code>YOUR_EMAIL<\/code> with an address that can receive renewal notices.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y mod_ssl certbot python3-certbot-apache\nsudo certbot --apache --redirect -d YOUR_DOMAIN -m YOUR_EMAIL --agree-tos --no-eff-email\nsudo sed -i 's#^APP_URL=.*#APP_URL=https:\/\/YOUR_DOMAIN#' \/var\/www\/laravelapp\/.env\nsudo -u apache -H php \/var\/www\/laravelapp\/artisan config:clear\nsudo -u apache -H php \/var\/www\/laravelapp\/artisan config:cache<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Certbot creates the HTTPS virtual-host changes and redirects HTTP. If DNS is not ready, skip the certificate commands, test on HTTP, and do not use that unencrypted endpoint for real credentials.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verify the Laravel installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These checks cover service health, Apache syntax, the Laravel release, database migrations, and the virtual host response before you open a browser.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl is-active firewalld httpd php-fpm mariadb\nsudo apachectl configtest\nsudo -u apache -H php \/var\/www\/laravelapp\/artisan --version\nsudo -u apache -H php \/var\/www\/laravelapp\/artisan migrate:status\ncurl -fsSI -H 'Host: YOUR_DOMAIN' http:\/\/127.0.0.1\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expect four <code>active<\/code> lines, <code>Syntax OK<\/code>, a Laravel 13 version, migration statuses, and an HTTP response. A <code>200 OK<\/code> means the page was served directly; a <code>301<\/code> is normal after Certbot enables the HTTPS redirect.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>active\nactive\nactive\nactive\nSyntax OK\nLaravel Framework 13.x\nHTTP\/1.1 200 OK<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once DNS is live, browse to <code>https:\/\/YOUR_DOMAIN<\/code>. The default Laravel page confirms that Apache is using the intended document root and PHP-FPM is executing the framework.<\/p>\n\n\n\n<aside class=\"vl-element vl-cta-banner\" aria-label=\"Deploy Laravel with root access\">\n\t<div class=\"vl-cta-banner__content\">\n\t\t<p class=\"vl-cta-banner__eyebrow\">AlmaLinux VPS<\/p>\n\t\t<h3 class=\"vl-cta-banner__title\">Deploy Laravel with root access<\/h3>\n\t\t<p class=\"vl-cta-banner__text\">Get an AlmaLinux VPS with the resources for PHP applications, MariaDB, and secure web traffic.<\/p>\n\t<\/div>\n\t<a class=\"vl-cta-banner__button\" href=\"\/buy-vps\" aria-label=\"View Linux VPS plans\">View Linux VPS plans<\/a>\n<\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><code>No matching Modules to list<\/code> or PHP is older than 8.3<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The server may be on an older AlmaLinux 9 minor release, or a different PHP stream is still enabled. Check the release and module inventory, then reset the stream before installing the native 8.3 profile.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/almalinux-release\nsudo dnf module list php\nsudo dnf module reset php -y\nsudo dnf module install php:8.3\/common -y\nphp -v<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the 8.3 stream is absent, update the AlmaLinux 9 packages and repository metadata before continuing; do not mix an EL8 repository into this server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>SQLSTATE[HY000] [1045] Access denied<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The password in <code>.env<\/code> may not match the account, or Laravel may still have old configuration cached. Test the TCP account separately and clear the cached settings after correcting the file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mariadb -h 127.0.0.1 -u laravel_user -p laravel_db -e 'SELECT 1;'\nsudo -u apache -H php \/var\/www\/laravelapp\/artisan config:clear\nsudo -u apache -H php \/var\/www\/laravelapp\/artisan migrate --force<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The query should print <code>1<\/code>. If it fails, reset the password for both local account hosts in MariaDB rather than granting the application administrative access.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>403 Forbidden<\/code> or <code>Permission denied<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Apache can read the application only when its group permissions and SELinux labels agree with the paths in the virtual host. Restore the labels and reapply the narrow writable-directory permissions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo restorecon -Rv \/var\/www\/laravelapp\nsudo chown -R root:apache \/var\/www\/laravelapp\nsudo find \/var\/www\/laravelapp -type d -exec chmod 0750 {} +\nsudo find \/var\/www\/laravelapp -type f -exec chmod 0640 {} +\nsudo chown -R apache:apache \/var\/www\/laravelapp\/storage \/var\/www\/laravelapp\/bootstrap\/cache\nsudo find \/var\/www\/laravelapp\/storage \/var\/www\/laravelapp\/bootstrap\/cache -type d -exec chmod 0770 {} +\nsudo find \/var\/www\/laravelapp\/storage \/var\/www\/laravelapp\/bootstrap\/cache -type f -exec chmod 0660 {} +\nsudo systemctl reload httpd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the denial continues, inspect <code>sudo ausearch -m AVC -ts recent<\/code> and fix the path named by SELinux instead of applying a broad mode such as <code>777<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>503 Service Unavailable<\/code> or PHP code appears as text<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PHP-FPM may be stopped, or Apache may not be reaching the socket named in the virtual host. Inspect the service, socket, and Apache configuration together.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status php-fpm --no-pager\nsudo test -S \/run\/php-fpm\/www.sock &amp;&amp; echo 'PHP-FPM socket exists'\nsudo journalctl -u php-fpm -n 40 --no-pager\nsudo apachectl configtest\nsudo systemctl restart php-fpm httpd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The socket test should print <code>PHP-FPM socket exists<\/code>, and the configuration test should return <code>Syntax OK<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hardening<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>Keep <code>APP_DEBUG=false<\/code> and run <code>config:cache<\/code> only after <code>.env<\/code> contains its final production values.<\/li>\n\n\n<li>Leave MariaDB port 3306 closed and restrict SSH at the provider firewall to trusted source addresses where possible.<\/li>\n\n\n<li>Back up <code>\/var\/www\/laravelapp<\/code> and the MariaDB database before upgrades. For a conservative SSH baseline, use the <a href=\"https:\/\/vpslake.com\/sshd-hardening-generator\">VPSLake SSH hardening generator<\/a>.<\/li>\n\n\n<li>Apply <code>sudo dnf upgrade -y<\/code> regularly and check certificate renewal with <code>sudo certbot renew --dry-run<\/code>.<\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">FAQ<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Does AlmaLinux 9 include PHP 8.3?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Current AlmaLinux 9 updates provide PHP 8.3 as an AppStream module. This guide selects <code>php:8.3\/common<\/code>, which avoids adding a separate PHP repository; an older minor release may need its package metadata updated first.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why are both <code>localhost<\/code> and <code>127.0.0.1<\/code> database users created?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">MariaDB can treat socket connections and TCP connections as different user-host combinations. The two entries make the explicit <code>DB_HOST=127.0.0.1<\/code> setting predictable while keeping both accounts local to the VPS.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I test the site before my domain is ready?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. The verification command sends a <code>Host<\/code> header to Apache on loopback, so you can test the virtual host before public DNS changes. Certbot still requires a real domain that resolves to the server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does Apache use <code>\/var\/www\/laravelapp\/public<\/code> instead of the project directory?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Laravel&#8217;s <code>public<\/code> directory is the intended web boundary. Keeping the document root there prevents visitors from requesting <code>.env<\/code>, <code>vendor<\/code>, and application source files directly.<\/p>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Does AlmaLinux 9 include PHP 8.3?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Current AlmaLinux 9 updates provide PHP 8.3 as an AppStream module. This guide selects `php:8.3\/common`, which avoids adding a separate PHP repository; an older minor release may need its package metadata updated first.\"}}, {\"@type\": \"Question\", \"name\": \"Why are both `localhost` and `127.0.0.1` database users created?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"MariaDB can treat socket connections and TCP connections as different user-host combinations. The two entries make the explicit `DB_HOST=127.0.0.1` setting predictable while keeping both accounts local to the VPS.\"}}, {\"@type\": \"Question\", \"name\": \"Can I test the site before my domain is ready?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes. The verification command sends a `Host` header to Apache on loopback, so you can test the virtual host before public DNS changes. Certbot still requires a real domain that resolves to the server.\"}}, {\"@type\": \"Question\", \"name\": \"Why does Apache use `\/var\/www\/laravelapp\/public` instead of the project directory?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Laravel's `public` directory is the intended web boundary. Keeping the document root there prevents visitors from requesting `.env`, `vendor`, and application source files directly.\"}}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"Install Laravel PHP framework on AlmaLinux 9 with PHP 8.3, Apache, MariaDB, Composer, firewalld, HTTPS, and SELinux-safe permissions for production.","protected":false},"author":1,"featured_media":1206,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[5,9],"tags":[95,71,154,73,72],"class_list":["post-1205","post","type-post","status-publish","format-standard","has-post-thumbnail","category-guides","category-vps-hosting","tag-almalinux-9","tag-apache","tag-laravel","tag-mariadb","tag-php","cs-entry"],"_links":{"self":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/comments?post=1205"}],"version-history":[{"count":1,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1205\/revisions"}],"predecessor-version":[{"id":4273,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1205\/revisions\/4273"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media\/1206"}],"wp:attachment":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media?parent=1205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/categories?post=1205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/tags?post=1205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}