{"id":12078,"date":"2025-06-04T11:36:15","date_gmt":"2025-06-04T05:51:15","guid":{"rendered":"https:\/\/nestnepal.com\/blog\/?p=12078"},"modified":"2025-06-08T14:44:32","modified_gmt":"2025-06-08T08:59:32","slug":"deploy-laravel-11-app-on-cpanel-or-vps-hosting","status":"publish","type":"post","link":"https:\/\/nestnepal.com\/blog\/deploy-laravel-11-app-on-cpanel-or-vps-hosting\/","title":{"rendered":"How to Deploy a Laravel App on cPanel or VPS Hosting (2025 Guide &#8211; Laravel 11 Ready)"},"content":{"rendered":"<p data-start=\"309\" data-end=\"655\">Modern PHP development has come a long way, and today\u2019s frameworks offer tools that make development seamless, maintainable, and scalable, like <a href=\"https:\/\/laravel.com\/\" target=\"_blank\" rel=\"noopener\">Laravel<\/a>. But when it comes to going live, deploying your web application isn\u2019t quite as simple as uploading files to a folder, especially if you&#8217;re using advanced tooling, routing, and environment-based configuration.<\/p>\n<p data-start=\"309\" data-end=\"655\"><img decoding=\"async\" class=\"alignnone wp-image-12080 lazyload\" data-src=\"https:\/\/nestnepal.com\/blog\/wp-content\/uploads\/2025\/06\/laravel-1024x759.png\" alt=\"laravel\" width=\"637\" height=\"472\" data-srcset=\"https:\/\/nestnepal.com\/blog\/wp-content\/uploads\/2025\/06\/laravel-1024x759.png 1024w, https:\/\/nestnepal.com\/blog\/wp-content\/uploads\/2025\/06\/laravel-300x222.png 300w, https:\/\/nestnepal.com\/blog\/wp-content\/uploads\/2025\/06\/laravel-768x569.png 768w, https:\/\/nestnepal.com\/blog\/wp-content\/uploads\/2025\/06\/laravel.png 1445w\" data-sizes=\"(max-width: 637px) 100vw, 637px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 637px; --smush-placeholder-aspect-ratio: 637\/472;\" \/><\/p>\n<p data-start=\"657\" data-end=\"801\">In this comprehensive, 2025-ready deployment guide, you\u2019ll learn how to bring your PHP framework (Laravel)-based app online using two common environments:<\/p>\n<ul data-start=\"803\" data-end=\"901\">\n<li data-start=\"803\" data-end=\"843\">\n<p data-start=\"805\" data-end=\"843\">Shared hosting with SSH (cPanel-based)<\/p>\n<\/li>\n<li data-start=\"844\" data-end=\"901\">\n<p data-start=\"846\" data-end=\"901\">A <a href=\"https:\/\/nestnepal.com\/blog\/what-is-vps-hosting\/\">virtual private server (VPS)<\/a> running Ubuntu or Debian<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"903\" data-end=\"1016\">This tutorial is designed to work with virtually any provider\u2014<a href=\"https:\/\/nestnepal.com\/\">Nest Nepal<\/a>, Hostinger, A2 Hosting, or your own VPS.<\/p>\n<p data-start=\"903\" data-end=\"1016\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-12081 lazyload\" data-src=\"https:\/\/nestnepal.com\/blog\/wp-content\/uploads\/2025\/06\/vps-300x300.jpeg\" alt=\"vps\" width=\"300\" height=\"300\" data-srcset=\"https:\/\/nestnepal.com\/blog\/wp-content\/uploads\/2025\/06\/vps-300x300.jpeg 300w, https:\/\/nestnepal.com\/blog\/wp-content\/uploads\/2025\/06\/vps-150x150.jpeg 150w, https:\/\/nestnepal.com\/blog\/wp-content\/uploads\/2025\/06\/vps-80x80.jpeg 80w, https:\/\/nestnepal.com\/blog\/wp-content\/uploads\/2025\/06\/vps.jpeg 500w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/300;\" \/><\/p>\n<hr data-start=\"1018\" data-end=\"1021\" \/>\n<h3 data-start=\"1023\" data-end=\"1066\">Before You Begin: System Requirements<\/h3>\n<p data-start=\"1068\" data-end=\"1153\">Before jumping into deployment, make sure the following tools and conditions are met:<\/p>\n<ul data-start=\"1155\" data-end=\"1572\">\n<li data-start=\"1155\" data-end=\"1246\">\n<p data-start=\"1157\" data-end=\"1246\">You\u2019ve built and tested your app locally using the latest version of Laravel (Laravel 11)<\/p>\n<\/li>\n<li data-start=\"1247\" data-end=\"1353\">\n<p data-start=\"1249\" data-end=\"1353\">Your hosting environment provides SSH access (either via cPanel Terminal or full root access on a VPS)<\/p>\n<\/li>\n<li data-start=\"1354\" data-end=\"1413\">\n<p data-start=\"1356\" data-end=\"1413\">Git access, or an FTP\/SFTP client if Git is unavailable<\/p>\n<\/li>\n<li data-start=\"1414\" data-end=\"1470\">\n<p data-start=\"1416\" data-end=\"1470\">PHP version 8.1 or higher is installed on the server<\/p>\n<\/li>\n<li data-start=\"1471\" data-end=\"1510\">\n<p data-start=\"1473\" data-end=\"1510\">Composer for Laravel is installed on the server<\/p>\n<\/li>\n<li data-start=\"1511\" data-end=\"1572\">\n<p data-start=\"1513\" data-end=\"1572\">A database like MySQL or MariaDB is ready to be connected<\/p>\n<\/li>\n<\/ul>\n<hr data-start=\"1574\" data-end=\"1577\" \/>\n<h2 data-start=\"1579\" data-end=\"1627\">Option 1: Deploying on cPanel with SSH Access<\/h2>\n<p data-start=\"1629\" data-end=\"1729\">This is the more accessible option for many developers, especially those using shared hosting plans.<\/p>\n<h3 data-start=\"1731\" data-end=\"1752\">1. Upload the App<\/h3>\n<p data-start=\"1754\" data-end=\"1882\">Start by zipping your project directory, but exclude the <code data-start=\"1811\" data-end=\"1820\">vendor\/<\/code> folder and <code data-start=\"1832\" data-end=\"1838\">.env<\/code> file to keep things secure and reduce the size.<\/p>\n<p data-start=\"1884\" data-end=\"1979\">You can upload it using the File Manager or clone the repository directly via Git if available.<\/p>\n<h3 data-start=\"1981\" data-end=\"2016\">2. File Placement and Structure<\/h3>\n<p data-start=\"2018\" data-end=\"2172\">Do not place the entire app inside the <code data-start=\"2057\" data-end=\"2071\">public_html\/<\/code> directory. Instead, upload the full project to a separate folder, like <code data-start=\"2142\" data-end=\"2165\">\/home\/username\/myapp\/<\/code>. Then:<\/p>\n<ul data-start=\"2174\" data-end=\"2382\">\n<li data-start=\"2174\" data-end=\"2245\">\n<p data-start=\"2176\" data-end=\"2245\">Either copy the contents of your <code data-start=\"2209\" data-end=\"2218\">public\/<\/code> folder to <code data-start=\"2229\" data-end=\"2243\">public_html\/<\/code><\/p>\n<\/li>\n<li data-start=\"2246\" data-end=\"2382\">\n<p data-start=\"2248\" data-end=\"2333\">Or, if symbolic links are supported, link the <code data-start=\"2294\" data-end=\"2303\">public\/<\/code> directory to <code data-start=\"2317\" data-end=\"2331\">public_html\/<\/code><\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">bash<\/div>\n<div class=\"sticky top-9\"><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\"><span class=\"hljs-built_in\">ln<\/span> -s ~\/myapp\/public ~\/public_html<br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<\/ul>\n<h3 data-start=\"2384\" data-end=\"2406\">3. Set Permissions<\/h3>\n<p data-start=\"2408\" data-end=\"2443\">Run the following via the terminal:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">bash<\/div>\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-sidebar-surface-primary text-token-text-secondary dark:bg-token-main-surface-secondary flex items-center rounded-sm px-2 font-sans text-xs\"><code class=\"whitespace-pre!\"><span class=\"hljs-built_in\">chmod<\/span> -R 775 storage<br \/>\n<span class=\"hljs-built_in\">chmod<\/span> -R 775 bootstrap\/cache<\/code><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p data-start=\"2504\" data-end=\"2556\">This ensures the necessary directories are writable.<\/p>\n<h3 data-start=\"2558\" data-end=\"2590\">4. Environment Configuration<\/h3>\n<p data-start=\"2592\" data-end=\"2675\">Upload your <code data-start=\"2604\" data-end=\"2610\">.env<\/code> file separately and update the database credentials accordingly.<\/p>\n<p data-start=\"2677\" data-end=\"2710\">Then, generate the app key using:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">vbnet<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\">php artisan <span class=\"hljs-keyword\">key<\/span>:generate<br \/>\n<\/code><\/div>\n<\/div>\n<h3 data-start=\"2746\" data-end=\"2767\">5. Database Setup<\/h3>\n<p data-start=\"2769\" data-end=\"2851\">Use cPanel\u2019s MySQL tools to create your database and user, then assign privileges.<\/p>\n<p data-start=\"2853\" data-end=\"2901\">Once the <code data-start=\"2862\" data-end=\"2868\">.env<\/code> is ready, migrate your database:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">nginx<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\"><span class=\"hljs-attribute\">php<\/span> artisan migrate<br \/>\n<\/code><\/div>\n<\/div>\n<h3 data-start=\"2932\" data-end=\"2967\">6. Update .htaccess for Routing<\/h3>\n<p data-start=\"2969\" data-end=\"3053\">Make sure the <code data-start=\"2983\" data-end=\"2994\">.htaccess<\/code> inside <code data-start=\"3002\" data-end=\"3016\">public_html\/<\/code> is properly handling route requests:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">apache<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-apache\">&lt;IfModule mod_rewrite.c&gt;<br \/>\nRewriteEngine On<br \/>\nRewriteRule ^(.*)$ public\/$1 [L]<br \/>\n&lt;\/IfModule&gt;<br \/>\n<\/code><\/div>\n<\/div>\n<hr data-start=\"3165\" data-end=\"3168\" \/>\n<h2 data-start=\"3170\" data-end=\"3215\">Option 2: Deploying on VPS (Ubuntu\/Debian)<\/h2>\n<p data-start=\"3217\" data-end=\"3332\">This method gives you full control over the environment and is preferred for more complex or high-performance apps.<\/p>\n<h3 data-start=\"3334\" data-end=\"3356\">1. Connect via SSH<\/h3>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">bash<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">ssh user@your-server-ip<br \/>\n<\/code><\/div>\n<\/div>\n<h3 data-start=\"3395\" data-end=\"3427\">2. Install Required Software<\/h3>\n<p data-start=\"3429\" data-end=\"3483\">If not already set up, install all necessary packages:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">bash<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">sudo apt <\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">update<br \/>\nsudo apt <\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">install php8.1 php8.1-fpm php8.1-mbstring php8.1-xml php8.1-mysql unzip curl <\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">git composer nginx mysql-server<br \/>\n<\/code><\/div>\n<\/div>\n<h3 data-start=\"3632\" data-end=\"3663\">3. Upload or Clone the Code<\/h3>\n<p data-start=\"3665\" data-end=\"3721\">Navigate to your web directory and pull the source code:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">bash<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\"><span class=\"hljs-built_in\">cd<\/span> \/var\/www<br \/>\nsudo git <span class=\"hljs-built_in\">clone<\/span> https:\/\/github.com\/yourname\/yourproject.git<br \/>\n<\/code><\/div>\n<\/div>\n<h3 data-start=\"3807\" data-end=\"3843\">4. Fix Ownership and Permissions<\/h3>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">bash<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">sudo <span class=\"hljs-built_in\">chown<\/span> -R www-data:www-data yourproject<br \/>\n<span class=\"hljs-built_in\">chmod<\/span> -R 775 storage bootstrap\/cache<br \/>\n<\/code><\/div>\n<\/div>\n<h3 data-start=\"3939\" data-end=\"3965\">5. Create the Database<\/h3>\n<p data-start=\"3967\" data-end=\"4016\">Log in to MySQL and create your database and user:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">sql<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> DATABASE myapp_db;<br \/>\n<\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">USER<\/span> <span class=\"hljs-string\">'myapp_user'<\/span>@<span class=\"hljs-string\">'localhost'<\/span> IDENTIFIED <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">'your_password'<\/span>;<br \/>\n<\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-sql\"><span class=\"hljs-keyword\">GRANT<\/span> <span class=\"hljs-keyword\">ALL<\/span> PRIVILEGES <span class=\"hljs-keyword\">ON<\/span> myapp_db.<span class=\"hljs-operator\">*<\/span> <span class=\"hljs-keyword\">TO<\/span> <span class=\"hljs-string\">'myapp_user'<\/span>@<span class=\"hljs-string\">'localhost'<\/span>;<br \/>\n<\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-sql\">FLUSH PRIVILEGES;<br \/>\n<\/code><\/div>\n<\/div>\n<p data-start=\"4206\" data-end=\"4244\">Update the environment config and run:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">bash<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">composer install<br \/>\nphp artisan migrate<br \/>\nphp artisan config:cache<br \/>\n<\/code><\/div>\n<\/div>\n<h3 data-start=\"4321\" data-end=\"4340\">6. Set Up Nginx<\/h3>\n<p data-start=\"4342\" data-end=\"4376\">Here\u2019s a basic Nginx config block:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">nginx<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-nginx\"><span class=\"hljs-section\">server<\/span> {<br \/>\n<span class=\"hljs-attribute\">listen<\/span> <span class=\"hljs-number\">80<\/span>;<br \/>\n<span class=\"hljs-attribute\">server_name<\/span> yourdomain.com;<br \/>\n<span class=\"hljs-attribute\">root<\/span> \/var\/www\/yourproject\/public;<br \/>\n<span class=\"hljs-attribute\">index<\/span> index.php index.html;<br \/>\n<\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-nginx\"><code class=\"whitespace-pre! language-nginx\">    <span class=\"hljs-section\">location<\/span> \/ {<br \/>\n<span class=\"hljs-attribute\">try_files<\/span> <span class=\"hljs-variable\">$uri<\/span> <span class=\"hljs-variable\">$uri<\/span>\/ \/index.php?<span class=\"hljs-variable\">$query_string<\/span>;<br \/>\n}<\/code><\/code><span class=\"hljs-section\">location<\/span> <span class=\"hljs-regexp\">~ \\.<\/span><\/p>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-nginx\"><span class=\"hljs-regexp\">php$<\/span> {<br \/>\n<span class=\"hljs-attribute\">include<\/span> snippets\/fastcgi-php.conf;<br \/>\n<span class=\"hljs-attribute\">fastcgi_pass<\/span> unix:\/run\/php\/php8.1-fpm.sock;<br \/>\n<span class=\"hljs-attribute\">fastcgi_param<\/span> SCRIPT_FILENAME <span class=\"hljs-variable\">$document_root<\/span><span class=\"hljs-variable\">$fastcgi_script_name<\/span>;<br \/>\n<\/code><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-nginx\">        <span class=\"hljs-attribute\">include<\/span> fastcgi_params;<br \/>\n}<br \/>\n}<br \/>\n<\/code><\/div>\n<\/div>\n<p data-start=\"4831\" data-end=\"4845\">Restart Nginx:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">nginx<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\"><span class=\"hljs-attribute\">sudo<\/span> systemctl restart nginx<br \/>\n<\/code><\/div>\n<\/div>\n<hr data-start=\"4885\" data-end=\"4888\" \/>\n<h2 data-start=\"4890\" data-end=\"4921\">Post-Deployment Checklist<\/h2>\n<p data-start=\"4923\" data-end=\"4945\">After the app is live:<\/p>\n<ul data-start=\"4947\" data-end=\"5250\">\n<li data-start=\"4947\" data-end=\"5045\">\n<p data-start=\"4949\" data-end=\"4980\">Cache configuration and routes:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">pgsql<\/div>\n<div class=\"sticky top-9\"><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\">php artisan config:<span class=\"hljs-keyword\">cache<\/span><br \/>\nphp artisan route:<span class=\"hljs-keyword\">cache<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<li data-start=\"5046\" data-end=\"5118\">\n<p data-start=\"5048\" data-end=\"5081\">Set up workers if you use queues:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">cpp<\/div>\n<div class=\"sticky top-9\"><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\">php artisan queue:work<br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<li data-start=\"5119\" data-end=\"5250\">\n<p data-start=\"5121\" data-end=\"5156\">Add a cron job for scheduled tasks:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">bash<\/div>\n<div class=\"sticky top-9\"><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\">* * * * * <span class=\"hljs-built_in\">cd<\/span> \/var\/www\/yourproject &amp;&amp; php artisan schedule:run &gt;&gt; \/dev\/null 2&gt;&amp;1<br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<\/ul>\n<hr data-start=\"5252\" data-end=\"5255\" \/>\n<h2 data-start=\"5257\" data-end=\"5292\">Common Errors and Quick Fixes<\/h2>\n<div class=\"_tableContainer_16hzy_1\">\n<div class=\"_tableWrapper_16hzy_14 group flex w-fit flex-col-reverse\" tabindex=\"-1\">\n<table class=\"w-fit min-w-(--thread-content-width)\" data-start=\"5294\" data-end=\"5772\">\n<thead data-start=\"5294\" data-end=\"5389\">\n<tr data-start=\"5294\" data-end=\"5389\">\n<th data-start=\"5294\" data-end=\"5316\" data-col-size=\"sm\">Issue<\/th>\n<th data-start=\"5316\" data-end=\"5349\" data-col-size=\"sm\">Cause<\/th>\n<th data-start=\"5349\" data-end=\"5389\" data-col-size=\"sm\">Fix<\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"5485\" data-end=\"5772\">\n<tr data-start=\"5485\" data-end=\"5580\">\n<td data-start=\"5485\" data-end=\"5507\" data-col-size=\"sm\">500 Internal Error<\/td>\n<td data-col-size=\"sm\" data-start=\"5507\" data-end=\"5540\">Bad file permissions, no <code data-start=\"5534\" data-end=\"5540\">.env<\/code><\/td>\n<td data-col-size=\"sm\" data-start=\"5540\" data-end=\"5580\">Check logs, set correct permissions<\/td>\n<\/tr>\n<tr data-start=\"5581\" data-end=\"5676\">\n<td data-start=\"5581\" data-end=\"5603\" data-col-size=\"sm\">Class Not Found<\/td>\n<td data-start=\"5603\" data-end=\"5636\" data-col-size=\"sm\">Missing vendor folder<\/td>\n<td data-col-size=\"sm\" data-start=\"5636\" data-end=\"5676\">Run <code data-start=\"5642\" data-end=\"5660\">composer install<\/code><\/td>\n<\/tr>\n<tr data-start=\"5677\" data-end=\"5772\">\n<td data-start=\"5677\" data-end=\"5699\" data-col-size=\"sm\">Forbidden Access<\/td>\n<td data-col-size=\"sm\" data-start=\"5699\" data-end=\"5732\">Wrong root directory<\/td>\n<td data-col-size=\"sm\" data-start=\"5732\" data-end=\"5772\">Verify the Nginx path or <code data-start=\"5755\" data-end=\"5766\">.htaccess<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"sticky end-(--thread-content-margin) h-0 self-end select-none\">\n<div class=\"absolute end-0 flex items-end\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"5774\" data-end=\"5777\" \/>\n<h2 data-start=\"5779\" data-end=\"5796\">Final Thoughts<\/h2>\n<p data-start=\"5798\" data-end=\"6069\">Deploying your modern PHP Laravel application on shared or private servers doesn\u2019t have to be painful. By following structured steps\u2014uploading your code properly, configuring permissions, managing environment variables, and setting up web servers\u2014you can go live with confidence.<\/p>\n<p data-start=\"6071\" data-end=\"6198\">For advanced workflows, consider integrating tools like GitHub Actions, Laravel Forge, Envoyer, or Ploi to automate deployment.<\/p>\n<p data-start=\"6200\" data-end=\"6216\">Happy launching!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Modern PHP development has come a long way, and today\u2019s frameworks offer tools that make development seamless, maintainable, and scalable,&#8230;<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[205,207],"tags":[279,310],"class_list":["post-12078","post","type-post","status-publish","format-standard","hentry","category-control-panel","category-vps","tag-vps-hosting","tag-vps-hosting-in-nepal"],"_links":{"self":[{"href":"https:\/\/nestnepal.com\/blog\/wp-json\/wp\/v2\/posts\/12078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nestnepal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nestnepal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nestnepal.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/nestnepal.com\/blog\/wp-json\/wp\/v2\/comments?post=12078"}],"version-history":[{"count":2,"href":"https:\/\/nestnepal.com\/blog\/wp-json\/wp\/v2\/posts\/12078\/revisions"}],"predecessor-version":[{"id":12083,"href":"https:\/\/nestnepal.com\/blog\/wp-json\/wp\/v2\/posts\/12078\/revisions\/12083"}],"wp:attachment":[{"href":"https:\/\/nestnepal.com\/blog\/wp-json\/wp\/v2\/media?parent=12078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nestnepal.com\/blog\/wp-json\/wp\/v2\/categories?post=12078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nestnepal.com\/blog\/wp-json\/wp\/v2\/tags?post=12078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}