• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

Help regarding to edit php.ini file

Hi,
I have created one project and in that project I make changes in some properties of php.ini like session_start =1, register_globals = On, auto_prepend file .. It works fine on my local machine but when I upload my files to my host server , I have no rights as root so that I can't change php.ini file. I try to use ini_set() function but it does not work.
So if anyone know how to edit php.ini file without root login then pl. give me answer.
0
gauravbe
Asked:
gauravbe
2 Solutions
 
KriekCommented:
In short, you can't. Obviously, your host has not given you permission to the php.ini for a reason, as you are most likely NOT the only site on the server.
0
 
alakritiCommented:
indeed, your webhost will not allow you access to the file. you could ask the system administrator to edit those lines but i doubt he/she will. I would reccomend coding around those features considering they leave large security holes in your applications.
0
 
ag0nyCommented:
As Kriek and alakriti said, you can't. But you can obtain the same results easily:

1) session_start = 1

Just add this line to the beginning of your scripts:

session_start();

2) register_globals = 1

Instead of accesing your form variables using $variablename, access them using $_REQUEST['variablename'] ($_REQUEST['variablename']['index'] if they're arrays).

3) auto_prepend

Just include the file at the very beginning of your scripts. For example, if the file you want to prepend is called 'header.php', then start your scripts like this:

include 'header.php';

That should do the job nicely.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
VGRCommented:
listen to ag0ny ;-)
0
 
Richard QuadlingSenior Software DeverloperCommented:
Listen to VGR ;-)
0
 
girish_nairCommented:
Is .htaccess too bad, that gauravbe had to put the prepend file in every php file?


I think we can suggest gauravbe to use .htaccess, Should We?

FYI: gaurav there is a .htaccess file which can be used to set some config values as per your need.

Now I forgot to ask you what OS+Webserver+PHP etc.etc. configurations are on your Server. Lots of thing depends on that also.

If you want to set .htaccess then read Apache manual and the PHP manual :)
0
 
snoyes_jwCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    Split: Kriek {http:#8200290} & ag0ny {http:#8200931}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

snoyes_jw
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now