Jump to content

From what i'm reading this is a problem with my host


aeroswat

Recommended Posts

Sounds like something your host did caused the problem. Most likely due to an upgrade. If you have your own php.ini file just set it to a folder the same level as your document root and see what happens. If it does work just remember to do some garbage collection.

 

 

HTH

Teamatomic

Link to comment
Share on other sites

Sounds like something your host did caused the problem. Most likely due to an upgrade. If you have your own php.ini file just set it to a folder the same level as your document root and see what happens. If it does work just remember to do some garbage collection.

 

 

HTH

Teamatomic

 

Unfortunately I don't believe they allow support for our own php ini's on the free hosting :/ Otherwise I would do that. I'm having a hell of a time with my sessions on this server. Anyone very familiar with 000webhost? Or do they have an idea for a better webhost out there that is free?

Link to comment
Share on other sites

Set up a folder the ntry something like this:

ini_set('session.gc_maxlifetime', '10800');
ini_set('session.gc_divisor', '1');
ini_set('session.gc_probability', '1');
ini_set('session.cookie_lifetime', '0');
ini_set('session.save_path', /path/to/sessions/app_name);
session_name('app_name');
session_start();

 

 

HTH

Teamatomic

Link to comment
Share on other sites

Set up a folder the ntry something like this:

ini_set('session.gc_maxlifetime', '10800');
ini_set('session.gc_divisor', '1');
ini_set('session.gc_probability', '1');
ini_set('session.cookie_lifetime', '0');
ini_set('session.save_path', /path/to/sessions/app_name);
session_name('app_name');
session_start();

 

 

HTH

Teamatomic

 

ini_set = disabled :(

Link to comment
Share on other sites

I think you might be getting a bit picky for free hosting. Hostmonster is cheap hosting. $4.95 a  month. Has everything you're after. They're who I use.

 

I just need something that's temporary so everything works before we convert. This is for my organization and our hands are tied because most places that offer worthwhile hosting do not accept purchase orders. I certainly am not shelling out my own $$ for hosting for them either. Thanks for the advice but it has to be free.

Link to comment
Share on other sites

So I used this code on 000 webhost just for sh**s and giggles to see if they were telling the truth...

 

<?php
session_save_path("/home/a1925824/sessions");
ini_set("session.gc_maxlifetime", 47000);
ini_set("session.gc_probability", 100);
session_start();
$session_life = ini_get("session.gc_maxlifetime");
$session_path = session_save_path();

echo $session_life . "<br />";
echo $session_path;
?>

 

and it outputs 47000 and /home/a1925824/sessions!

 

This should mean that I do in fact have access to the ini_set function! Does that necessarily mean that my changes are permanent tho? Also I have never done this before but I have read about it... is it possible to create my own php ini file to override the settings in their php ini for my site only? That way I wouldn't have to set the path/lifetime/etc everytime i start a session. If so does anyone know of a good tutorial page on how to do this?

Link to comment
Share on other sites

ini_set is for the script you're running. Definitely not permanent.  The only way to know for sure if a custom php.ini will work is to try it. Copy a php.ini from somewhere else to your root, change a couple of things then use ini_get to get the values and see if it shows your changes.

 

K i will try that. I was reading that it inherits all the settings of the global ini. Does that mean that I can remove everything in there except what I am changing and it should inherit the rest?

Link to comment
Share on other sites

Ok I have tried uploading a php ini file with the following entered into it in both the folder that is outside the public_html which is my highest level directory I can access and my public_html folder. Neither will change the values when I use the aforementioned functions.

 

[code=php:0]

[session]
session.save_path = "/home/a1925824/sessions"
session.gc_probability = 1
session.gc_divisor     = 1000
session.gc_maxlifetime = 45000

Link to comment
Share on other sites

So have you even asked your web host about fixing the default session.save_path setting or if you can use a local php.ini (some times it is named something else) or if you can use a .htaccess file for php settings (requires php to be running as an Apache Module)?

 

Edit: And based on the 000webhost FAQ's that I just read, if you can set the php settings in question, you do it in a .htaccess file using php_flag or php_value statements.

Link to comment
Share on other sites

So have you even asked your web host about fixing the default session.save_path setting or if you can use a local php.ini (some times it is named something else) or if you can use a .htaccess file for php settings (requires php to be running as an Apache Module)?

 

Edit: And based on the 000webhost FAQ's that I just read, if you can set the php settings in question, you do it in a .htaccess file using php_flag or php_value statements.

 

Yes I have before :/ They don't do a very good job of answering questions >< Sorry I've never handled my own installation of php before and I am fairly new to the language. I've never done this stuff before. I'll look into the php_flag/php_value. Could I put that in an htaccess on my public_html folder?

Link to comment
Share on other sites

Got it! They do accept that! Thanks a million ^_^

I placed it in my public_html folder and put the following inside of it

 

php_value session.gc_maxlifetime 21600

php_value session.save_path /home/a1925824/sessions

php_value session.gc_probability 100

 

Thanks everyone that helped me out :)

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.