Jump to content

session start - no such file


ricardo_creates

Recommended Posts

Hey php freaks.

So I made a copy of a wordpress website to local host.

All is working finally except when I go to the website and the image attached shows on top.

Basically it says:

Warning: session_start(): open(/var/cpanel/php/sessions/ea-php73\sess_fc3543585c1da50b97272ff08b71c725, O_RDWR) failed: No such file or directory (2) in C:\Users\ricar\Local Sites\localazana\app\public\wp-content\themes\azana-child\header.php on line 11

Warning: session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/ea-php73) in C:\Users\ricar\Local Sites\localazana\app\public\wp-content\themes\azana-child\header.php on line 11

I went searching and for what I understood might be some problem with the php.ini file that I might have to change the session.save_path. Now it's session.save_path = "/var/cpanel/php/sessions/ea-php73"

 

But I have no idea what it should be changed for and why this is hapenning and I did more migrations before and this never happened.

Any idea and help would be much appreaciated

Thanks

 

Captura de ecrã 2021-10-20 223335.png

Link to comment
Share on other sites

31 minutes ago, ricardo_creates said:

Now it's session.save_path = "/var/cpanel/php/sessions/ea-php73"

You can't simply copy php.ini settings from one machine and put them on another machine. Same way you can't take a remote that worked on one TV and expect it to work on a different TV.

Remove/undo those settings you copied.

Link to comment
Share on other sites

15 hours ago, requinix said:

That /var/cpanel is not a default setting for php.ini so something put that value there...

Where is this php.ini exactly? What is the setup you have for running this site on Windows - are you using XAMPP or WampServer or what?

I am using Local ( local by Flywheel). The php.ini localsite>app>public>php.ini.

When I open it it was the setting that was there. So it might had been already in the live site as I just did the copy. Who put it there in first place, no idea. So you think I should change it or what?

Link to comment
Share on other sites

18 hours ago, requinix said:

That /var/cpanel is not a default setting for php.ini so something put that value there...

Where is this php.ini exactly? What is the setup you have for running this site on Windows - are you using XAMPP or WampServer or what?

So I went search more and found this post:

And one user said : 

Quote

OMG - so just looked through the website files and I found a user generated .user.ini file which is setting the session path. It must have been done by a previous dev.

Can confirm the site is working as desired once I removed the user.ini file.

So  can this be the case? I have also a user.ini file where I went to see there is that session start like in the php.ini.

I am not php expert so don't want to make it worst but I know as a fact that this website many people touch and changed it before me so, just guessing.

Can you help?

Thank you

Link to comment
Share on other sites

Using something like Local would explain a lot. But I don't know Local much.

Are you sure you're using it? What little I can find that describes technical details suggests that it should be running everything in a separate environment - like a separate operating system - than your own, so you shouldn't be seeing any error messages that mention files in C:\...
How did you come to use Local, too? Is that something you were told to do by someone when you wanted to have a copy of the site?

Link to comment
Share on other sites

45 minutes ago, requinix said:

Using something like Local would explain a lot. But I don't know Local much.

Are you sure you're using it? What little I can find that describes technical details suggests that it should be running everything in a separate environment - like a separate operating system - than your own, so you shouldn't be seeing any error messages that mention files in C:\...
How did you come to use Local, too? Is that something you were told to do by someone when you wanted to have a copy of the site?

Out of curiousity why it would explain a lot? Honest question

I use local because when I start learning more about wordpress was the most simple local host approach to use. I did many website with it, import export and all good, pretty simple.

So never had a reason to complain.

The thing is that the website has 47 plugins active, had 2 previous developers that mess with the website and the owner is not sure what they did or not. It’s hosted on shared host so for example I tried to use Duplicator or other plugin and just breaks in the middle.

So my guess is that the live website has many configs that are messed up and when I copy to local those configs came with it.

I need a copy of the website because I want to fix and erase all those plugins but need to do it on a safe enviroment

 

Link to comment
Share on other sites

52 minutes ago, ricardo_creates said:

Out of curiousity why it would explain a lot? Honest question

The number one thing it would explain is how you got PHP settings onto your machine that don't make sense, given that you didn't put them there yourself.

 

52 minutes ago, ricardo_creates said:

So my guess is that the live website has many configs that are messed up and when I copy to local those configs came with it.

The configs aren't messed up. They work fine. On the shared hosting server. They may not work fine for you on your personal computer.

Find the php.ini and comment out (put a semicolon ; at the beginning of the line) the setting for the session.save_path. Just make sure you don't push that change back up to the server.

Link to comment
Share on other sites

21 hours ago, requinix said:

The number one thing it would explain is how you got PHP settings onto your machine that don't make sense, given that you didn't put them there yourself.

 

The configs aren't messed up. They work fine. On the shared hosting server. They may not work fine for you on your personal computer.

Find the php.ini and comment out (put a semicolon ; at the beginning of the line) the setting for the session.save_path. Just make sure you don't push that change back up to the server.

It's working now...So the link I put before from a c panel forum they talked about .user.ini. And I went to search there and there was also that session. I comment that out there ( before I saw your post), clean cookies, restart pc and it works now.

So question for you: Shoud I still comment also in php.ini? Should I leave it like this?

And thank you for your help and lessons

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.