What you’ll need
- A working Laravel app locally with Composer and Node
- DirectAdmin access
- Your DirectAdmin username
Laravel expects only its public/ folder on the web. This layout keeps application code, .env and storage outside public_html. The same approach works for Symfony and other Composer-based frameworks. Deploying a PHP application (Composer, Laravel and frameworks)
Steps
Step 1: Match PHP versions
Check the PHP version in
composer.jsonand set the domain to match in Account Manager then Domain Setup. How to change the PHP version in DirectAdminStep 2: Build a production copy
Locally:
composer install --no-dev --optimize-autoloader npm ci && npm run buildStep 3: Package the app
Zip the project without
node_modules,.gitand your local.env.Step 4: Upload outside the web root
Upload and extract to
/home/USERNAME/apps/myapp. How to upload and extract a zip fileStep 5: Publish the public folder
Copy the contents of
apps/myapp/publicintodomains/yourdomain.co.uk/public_html, including.htaccess.Step 6: Repoint index.php
Edit
public_html/index.phpso thevendor/autoload.phpandbootstrap/app.phppaths reach/home/USERNAME/apps/myapp/. Use absolute paths to avoid counting../.Step 7: Create the database
Create a database and user. How to create a MySQL database in DirectAdmin
Step 8: Configure .env
Create
apps/myapp/.envwithAPP_ENV=production,APP_DEBUG=false,APP_URL,APP_KEYfrom your local app, and the database details withDB_HOST=localhost. Storing configuration and secrets outside public_htmlStep 9: Load the schema
Run migrations locally against a fresh database, export it, and import on Traxio with phpMyAdmin. Export a database and import it somewhere else
Step 10: Storage and links
Ensure
storageandbootstrap/cachefolders are writable (755). For public uploads, copy or createpublic_html/storagepointing at your storage files, or serve them through a route.Step 11: Schedule the task runner
Create a cron job every minute:
/usr/local/bin/php /home/USERNAME/apps/myapp/artisan schedule:run >> /dev/null 2>&1
Check it worked
The app loads at your domain with APP_DEBUG=false, database-backed pages work, and .env is not reachable at any URL.
If something goes wrong
| What happens | What to do |
|---|---|
| 500 error | Check the domain error log and storage/logs/laravel.log. Usually a path in index.php or .env. 500 Internal Server Error: how to fix it |
| Class not found | vendor/ wasn’t uploaded completely. “Call to undefined function” PHP error |
| Stale configuration | Delete cached files in bootstrap/cache/ after changing .env. |
New to Traxio? The PHP hosting page lists the PHP versions, database and tools every account gets, free for the first 30 days.