?
Solved

Help regarding to edit php.ini file

Posted on 2003-03-24
8
Medium Priority
?
329 Views
Last Modified: 2012-05-04
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
Comment
Question by:gauravbe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 1

Accepted Solution

by:
Kriek earned 100 total points
ID: 8200290
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
 
LVL 8

Expert Comment

by:alakriti
ID: 8200409
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
 
LVL 1

Assisted Solution

by:ag0ny
ag0ny earned 100 total points
ID: 8200931
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: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

 
LVL 15

Expert Comment

by:VGR
ID: 8201249
listen to ag0ny ;-)
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 8202277
Listen to VGR ;-)
0
 
LVL 4

Expert Comment

by:girish_nair
ID: 8202899
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
 
LVL 33

Expert Comment

by:snoyes_jw
ID: 11942559
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question