Exoseed's avatar

Exoseed liked a comment+100 XP

1mo ago

if you cant run artisan, or ssh into the server, find a more competent host

Exoseed's avatar

Exoseed liked a comment+100 XP

1mo ago

I'd be really surprised if you couldn't run PHP. How would you even deploy the app without it? How would you run migrations, scheduled tasks, or queue workers?

Exoseed's avatar

Exoseed wrote a reply+100 XP

1mo ago

Ok I did have an SSH access and it worked! Had a couple other issues but I was able to resolve them as well. Thanks for the help!

Exoseed's avatar

Exoseed wrote a reply+100 XP

2mos ago

Yes, that makes sense. Should have thought of that. Only issue with proceeding with your solution is that I don't think I can run php artisan commands on the production server which is a shared hosting. Is there any workaround?

Exoseed's avatar

Exoseed liked a comment+100 XP

2mos ago

Let's take a look at this part:

Even weirder: in my public folder, the "logs" folder is generated with an absolute path for the name: "C:\Users[my name][my website]\storage\logs"

Are you developing locally on Windows but deploying to a Linux server? If so, then this is definitely a cache issue: you executed some cache command on your local machine, then copied the compiled cache files to the production server. Linux tries to use your locally configured log path, but doesn't understand the Windows-style path name, hence the weird filename.

Try running php artisan optimize on the production server. That recompiles several caches (config, routes, etc.) using the environment variables of your live server. If that also fails, clear the previous caches first by running php artisan optimize:clear.

Exoseed's avatar

Exoseed liked a comment+100 XP

2mos ago

@exoseed Without knowing your codebase or how you’re actually deploying your site to shared hosting, you’re going to need to view your application’s error logs for more information on what’s going wrong. Or alternatively, just do a fresh upload of your codebase. However, be sure to back up anything like user-uploaded files if you’re storing them somewhere like your /storage directory instead of a third-party storage solution like S3.

Exoseed's avatar

Exoseed liked a comment+100 XP

2mos ago

Is it the same webhosting ?

Shared webhosting are sometimes different.

I also have a shared webhosting, but I don't need to put the public directory of the Laravel project inside a specific folder. So no need to change anything with the structure of the project, I just have to point the domain name to the public folder of the Laravel project and it's done.

So I think that it depends what you have to do to get it working on your webhosting.

Can you give more informations please ?

Exoseed's avatar

Exoseed wrote a reply+100 XP

2mos ago

Yes I did backup user-uploaded files. My process was:

  1. Backup user-uploaded files
  2. Remove everything from server (since I feared some malicious files might be hidden here and there, I'd rather start clean)
  3. I ran npm run build locally and then reupload the entire files to the server, with the correct production .env and reuploading backudep files from step 1
Exoseed's avatar

Exoseed wrote a reply+100 XP

2mos ago

It's the same webhosting, really I just updated the files. Nothing changed on the server, nothing on the MySQL database, everything stayed the same, I just uploaded the updated version of the site from local (which is working fine) on my server. I didn't have to change anything with the structure too, it's pointing to the public folder as it should.

Sorry if I'm not being clear, English is not my first language and I honestly don't have a clue at what went wrong.

Exoseed's avatar

Exoseed started a new conversation+100 XP

2mos ago

Hello,

So I recently had a security issue with my website (supposedly because of an outdated version or Livewire), which prompted me to update it. I went from Laravel 10 to Laravel 11, everything works fine locally and when I uploaded it on my shared hosting, it doesn't.

I have a couple of issues, probably linked: When I go to my homepage, I get this error: "SQLSTATE[HY000] [2002] No such file or directory" My MySQL server didn't change in the process, credentials in .env file are the same, so I don't really get the issue.

Even weirder: in my public folder, the "logs" folder is generated with an absolute path for the name: "C:\Users[my name][my website]\storage\logs"

Any idea as to why this happen?

Thanks for the help!