Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Can’t delete var/session directory
 
nivekiam
Jr. Member
 
Total Posts:  30
Joined:  2007-11-28
 

I’m trying to remove Magento from my site, but cannot delete the var/session directory.  I tried creating a php script to first change permissions so I could delete the directory, then accessing that script through my site so it ran as the web server user.  But that was a no go.  Then I tried various other php recursive delete functions I found on the internet.

The fricking files are owned by the webserver, why can’t I have the webserver delete them?????

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Magento does not set any special permissions for session files, it uses standard PHP session files handling, you can see that in app/code/core/Mage/Core/Model/Session/Abstract/Varien.php, method start()

 
Magento Community Magento Community
Magento Community
Magento Community
 
nivekiam
Jr. Member
 
Total Posts:  30
Joined:  2007-11-28
 

hmmm, o.k.  I’ll have to take a closer look at this.  I was trying to setup (unsuccessfully) Magento under HTTPS.  I’m starting to wonder if my host has some different setting between HTTP and HTTPS.  I’ll have to see what they say in reply to my support request.

Perhaps I was a little hasty in submitting a couple of bug reports…

The unsuccessful part of installing under HTTPS was this:
It wouldn’t go past the first page.  The “Continue” button would remain greyed out (the javascript wasn’t loading).  Looking at the generated HTML source I saw a bunch of lines that looked like this:
src="{{secure_protocol}}://{{secure_host}}:{{secure_port}}/magento

Looking at the code, I noticed any function call to getBaseUrl() worked just fine, but any call to getJsUrl() or getSkinUrl() would not return the correct page under HTTPS, however, if I moved the magento directory to my HTTP directory then everything would load up just fine.

Thanks,
Kevin

 
Magento Community Magento Community
Magento Community
Magento Community
 
nivekiam
Jr. Member
 
Total Posts:  30
Joined:  2007-11-28
 

Just got the reply back from my host.  There is no difference between for default permission masks between the http and https directory structures.

The var/session was set at by Magento, making it impossible for me or the user noboby (the web server user) to delete the directory or any files, let alone change the permissions.
dr----x--t 2 nobody users 512 Nov 28 11:29 session

Here is was my host said in their reply to me:
“The permissions on the session directory would not allow user nobody to
change permissions on the directory or files. They were set to:

dr----x--t 2 nobody users 512 Nov 28 11:29 session”

Please tell me why Magento set the permissions like that and how to change it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Hm… that’s indeed weird permissions, it should be drwxrwxrwx (0777), which is set in app/code/core/Mage/Core/Model/Config.php on approx. line 300:

if (!file_exists($dir)) {
    mkdir
($dir0777true);
}
How it became dr----x--t is a mystery for me.

What company are you hosting with?
Other folders in var/ have same permissions? what about inside var/session and var/cache?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nivekiam
Jr. Member
 
Total Posts:  30
Joined:  2007-11-28
 
Moshe - 28 November 2007 12:27 PM


What company are you hosting with?
Other folders in var/ have same permissions? what about inside var/session and var/cache?

I host with Pair Networks http://www.pair.com

I’m wondering if this is related to the other problem of not being able to proceed with the install through HTTPS, but I can just fine with HTTP.

Here’s what I did.

I downloaded and unpacked magento-0.6.13700.tar.gz.  I was logged in through SSH and used wget to grab the file.  Once it was unpacked I changed the permissions of the few files and directories according to the installation instructions.

[edit: removed domain]
Then I tried to go to https://secure.example.com/magento to do the install.  If you go to that page, you’ll see what I mean.  If I move the magento directory to my non-https site then it works just fine.

I have completely removed magento and unpacked it again, but have not set the permissions on any directories, but you can at least see what I was talking about.  The calls to getBaseUrl() get processed, but the calls to getJsUrl() and getSkinUrl() do not.

If I move magento to my non-http webroot then everything appears to work fine, though I have not completed an install yet to see if there are other problems down the road.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@nivekiam: the problem with installation over https was found that and fix will be available in next release.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top