SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    chicago
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help needed with php.ini

    Hello all,

    I just got a dedicated server account, needless to say, I am lost. Everything has been uploaded and works fine, however, I have been having some problems with some scripts that I installed recently. I was informed that I needed to make some simple changes to my php.ini file in order for them to work properly. I have no idea how to access php.ini so that I can make the changes. Can someone please explain how to access / edit php.ini ? I know exactly what I need to turn on and off. I just need to know how to get there.

    Thanks.

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,650
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    broad,

    From the sound of it, this is a problem that will be ISP specific and should be within the control panel that was provided with your account.

    If not (and you have "root access"), you should be able to telnet to perform a whereis php.ini then go and use vi to edit.

    Once you get that straightened out, don't forget to restart the server (if Apache -- dunno about IIS).

    Sorry I can't be of more help -- it's been too long since I've played in that arena.

    I can only hope this is of some help, er, better than being ignored.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2004
    Location
    NH
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Who is your hosting company? You may be able (depending on the configuration) to use a php.ini, or possibly even a .htaccess file within the directory that you are running your scripts from.

    We could probalby use a little more information about what values you are trying to alter and whether you have shell access to you account or not.

    Rob.

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,650
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    broad,

    1skydive is correct as you can use your PHP script to modify php.ini values, too.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    chicago
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for thr input, sorry I didn't give more info.

    My hosting company is Ipower, I do have shell access, through a program called putty(does that sound right?). I've logged in it before, but was lost, as it is command based. I do have access to the control panel (Plesk 7.5 Reloaded). And finally the changes I need to make are as follows :

    I have to turn safe mode off and magic quotes on.

    Again sorry I didn't give this info before. Is there anyway you could give me detailed instructions on how to get to and change this file ? Also, when I do a <?php info, it shows me the path of php.ini, but when I try to access it via FTP pro, it's not there. Is this a root access issue ? How would one use FTP functions with root password / access ? Through control panel ? Anyway I'm not sure about that either, if you could answer any of these questions, I'd be extremely happy. Thanks.

  6. #6
    SitePoint Zealot
    Join Date
    Jun 2004
    Location
    NH
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by broadbandone
    I have to turn safe mode off and magic quotes on.
    Well, I'm not going to lecture you on the rights and wrongs of both of these settings, but if you do a google search on both terms, you'll find some interesting reading. Here are a couple of links.

    http://us4.php.net/features.safe-mode

    http://docs.php.net/en/security.magicquotes.html

    If you are unable to find your php.ini after logging on with putty, and no-one at your isp will help, here is a suggestion.

    Like I mentioned before. In your webroot directory, place a file called .htaccess

    In that file, put the following:

    magic_quotes_gpc = On
    php_flag safe_mode Off

    That should do it. if not, post again and let us know.

  7. #7
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    chicago
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1stskydive,

    Thanks for responding. I was trying to drop that .htaccess file in, I have a couple questions. When I create it, it comes out as a notebook file, is this correct ? Second, I literally just type magic_quotes_gpc = On and php_flag safe_mode Off ? And finally, after I uploaded the .htaccess file to my server, I het refresh (wftp) and it is not in the folder... what am I doing wrong ?

    Thanks.

  8. #8
    SitePoint Zealot
    Join Date
    Jun 2004
    Location
    NH
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup, just type it in as it looks here.

    Also, the .htaccess is a hidden file. The (.) makes it hidden so you'll have to configure your ftp client to show hidden files, but almost certainly the file is there, you just can't see it.

  9. #9
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    chicago
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey. I tried dropping the file in. It didn't help. Anything else I can try ? I just moved to this server, things worked fine on my last server, but now most of my scripts seem to have major problems. I know and have been told that these settings are effecting my scripts. How can I change these settings in php.ini ? I still can't find php.ini.

    Any help / advice would be welcomed. Thanks.

  10. #10
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    safe mode can only be turned on or off in php.ini or httpd.conf.

    If you create a test php page, called test.php for example and in there put just this:
    <?php phpinfo() ?>
    then upload that to your server and view it in your browser. It will tell you at the top of that page where you php.ini file is located.
    I'd then use your putty application to connect to the server. Editing from a shell can be icky if you're not used to something like vi, so it might be better to copy the php.ini file into your ftp folder then download it, edit it locally then ftp it back and copy it back in place. You'll need to restart apache as someone mentioned above, either 'apachectl graceful' from the 'putty shell' or use your control panel.

    In php.ini just look for safe_mode and magic_quotes (runtime and gpc) and change them to Off. Hope this helps. If not you might be better off getting someone you trust to shell in and do it for you.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •