Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mohammednehru's avatar

ON hosting problem

Hi, I deployed a laravel website using Cpanel and configure everything but when I need to access login or register I get this error.

https://l.top4top.io/p_1502gua9u1.png

Auth::routes(); this is the routes.

0 likes
14 replies
mohammednehru's avatar

No, I didn't touch this file. I found solution that stay I need to add _ to config.php in Bootstrap/cash/config.php But if do this the host database connection will corrupt

Sti3bas's avatar

@mohammednehru the only option I could think of is to open bootstrap/cache/config.php file and manually replace your local paths with the shared hosting paths.

mohammednehru's avatar

Is there any way to deploy the Laravel app without all these problem. How I deployed it:

  • creating database using MySQL wizard.
  • zip Laravel project files except public and add theme to new folder in main directory.
  • adding the public folder content to public_html and change path in index.php.
mohammednehru's avatar

I don't have any problem in these files I checked it many times

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Is this a windows server? The path is d:

Any chance you just copied your local cached version to a server? If you can use artisan the try this

php artisan optimize:clear

If not the try adding this route and calling it from the browser

Route::get('/clear-cache', function() {
     Artisan::call('optimize:clear');

});
mohammednehru's avatar

It's work now thank you. But there's a DB problem when registering a new user or adding anything to DB https://k.top4top.io/p_1503m2sz41.png

This is .env

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=boryelpa_yasDB
DB_USERNAME=boryelpa_yasUSER
DB_PASSWORD=12332100mm

database.php

        'mysql' => [
            'driver' => 'mysql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', 'localhost'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'boryelpa_yasDB'),
            'username' => env('DB_USERNAME', 'boryelpa_yasUSER'),
            'password' => env('DB_PASSWORD', '12332100mm'),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
            ]) : [],
        ],

database name in my host PHPMyAdmin https://g.top4top.io/p_150236a3n3.png

Sinnbeck's avatar

If it solved the issue consider marking a best answer. This seems like a new and unrelated issue, so please create a new thread for it.

MThomas's avatar

Did you change the default users table migration file? Is the 'id' column still a primary key? Did you change the default registration files/controllers/trait?

It seems like it does not 'add' the ID to the DB.

Please or to participate in this conversation.