1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to create php5.ini file..?

Discussion in 'PHP' started by Abhik, Mar 12, 2008.

  1. #1
    I bought a script yesterday and when installing it in my godaddy hosting, it was asking to turn on the register_global.
    I asked GoDaddy support and the said to create a php5.ini file and upload it in the root.
    Great, now how do I create one? I need all other settings to stay intact and only to turn on that golbal_register.
    SEMrush
     
    Abhik, Mar 12, 2008 IP
    SEMrush
  2. CodyRo

    CodyRo Peon

    Messages:
    365
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Make a text file with the name "php5.ini" and put the following in it:

    
    register_globals = On
    
    Code (markup):
    Then put it in the same directory as your script.
     
    CodyRo, Mar 12, 2008 IP
    Abhik likes this.
  3. Abhik

    Abhik ..:: The ONE ::..

    Messages:
    11,340
    Likes Received:
    606
    Best Answers:
    0
    Trophy Points:
    410
    Digital Goods:
    2
    #3
    Thanks for the help, but it wasn't working.
    I found the php.ini file in my hosting root directory and made the changes there and its now working.
     
    Abhik, Mar 13, 2008 IP
  4. joebert

    joebert Well-Known Member

    Messages:
    2,152
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #4
    The script must be running on Godaddys default PHP4 then.

    Godaddy has PHP 4 and 5 available. 4 is the default handler for "*.php" files, you have to specificly tell their server to use PHP5 with htaccess.
    AddHandler x-httpd-php5 .php .php5
    AddHandler x-httpd-php .php4
    Code (markup):
    The "php.ini" file you found is the one that's used for PHP4. If you ever need to change settings for PHP5 and end up doing somthing similar to what I just described, you'll do like CodyRo mentioned and create a text file named "php5.ini", add your settings to that ini instead, and upload it to the same place you see "php.ini".

    Godaddys tech may have assumed you were already using PHP5, getting their servers to use 5 instead of 4 seems to be a pretty common question and PHP5 may have carried over to your ticket in their thought process.
     
    joebert, Mar 13, 2008 IP
    Abhik likes this.
  5. Robert22

    Robert22 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Where about's do you add the handler code?

    All my websites have suddenly gone down. They do not load. According to godaddy i need to change my php.ini file to php5.ini - But they don't bloody well tell you how to go about doing this!

    Can I not simply just change the file name from php.ini to php5.ini?

    Any help would be appreciated. Please keep any advice simple as I don't know php.
     
    Robert22, Sep 5, 2009 IP
  6. Robert22

    Robert22 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ? :confused:
     
    Robert22, Sep 5, 2009 IP
  7. dontgodaddy

    dontgodaddy Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I spent half the day trying to figure this out.
    It seems to only be a problem if you're running on a Windows IIS server.

    I've attached a copy of my php5.ini file as a .txt
    (I removed most of the comments to make the file small enough to upload here)
    or you can download the PHP 5.2.11 zip file from
    http://windows.php.net/download/ -- it comes with a
    php.ini-dist file and apply the following changes:


    extension_dir = "c:\php5\ext" ;; must change ;;
    include_path = ".;C:\php5\pear" ;; must change ;;
    error_log = syslog
    magic_quotes_gpc = Off
    output_buffering = 4096
    register_argc_argv = Off

    SMTP = relay-hosting.secureserver.net ;; should change ;;
    sendmail_from = webmaster@secureserver.net ;; should change ;;
    upload_tmp_dir = D:\Temp\php ;; must change? ;;
    variables_order = "GPCS"

    ;;;;; THESE ARE THE MAIN IIS ONES ;;;;;;
    cgi.force_redirect = 0 ;; MUST change ;;
    fastcgi.impersonate = 1 ;; MUST change ;;

    ;;;;; and enable these modules ;;;;;;
    ;; php_mysql.dll is very important (at least for me)
    ;; not sure about the others.
    extension=php_curl.dll
    extension=php_gd2.dll
    extension=php_gettext.dll
    extension=php_mbstring.dll
    extension=php_mcrypt.dll
    extension=php_mhash.dll
    extension=php_mssql.dll
    extension=php_mysql.dll ;; very important ;;
    extension=php_mysqli.dll
    extension=php_openssl.dll
    extension=php_pdo.dll
    extension=php_soap.dll
    extension=php_xsl.dll
    extension=php_zip.dll

    ;;;;; ok, that worked, but i'll change these ;;;;;
    ;;;;; just to match what godaddy has ;;;;;
    session.gc_divisor = 1000
    session.hash_bits_per_character = 5
    session.save_path = "D:\TEMP\PHP"

    ;;;;; I changed these for my own purposes
    ;;;;; This is the reason I did all this in the first place
    ;;;;; so I could upload large videos using Drupal
    max_execution_time = 1600
    max_input_time = 1600
    post_max_size = 128M
    upload_max_filesize = 128M


    The modifications have to be placed in their respective locations within the ini file, so just pasting all that at the bottom of php5.ini won't work.. You have to change the values where they occur by default.

    Hope that helps, Good luck!
     

    Attached Files:

    dontgodaddy, Oct 23, 2009 IP
  8. scarr1

    scarr1 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I am having trouble with Godaddy and my Joomla Backend. When I try to install JCE, or anthing large I get an error. I was told by GoDaddy that I need to create a php5.ini file that changed the max_execution_time. Basically anthing large I cannot install.
    I've used the sample codes from various sites, but when I upload the php5.ini file to the root Joomla disconnects from the MySQL databases. See error below.

    Database Error: Unable to connect to the database:The MySQL adapter "mysql" is not available.

    HELP PLEASE!
     
    scarr1, Sep 20, 2010 IP
  9. ivan.kristianto

    ivan.kristianto Peon

    Messages:
    136
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    you can use htaccess to turn the register_global off.
     
    ivan.kristianto, Sep 20, 2010 IP
  10. LeilaHauck

    LeilaHauck Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Hello,

    Having a problem downloading my new website. Apparently godaddy.com doesn't have Zend Optimizer in their hosting package. They did send me an article: BUT.. I have no idea on how to create a php5.ini text file and where to place it.. I wish they could make life a little simpler!! Anyone can help me??? I'm trying to get my website that is CMS template uploaded. Thank you in advance for any assistance. :)
     
    LeilaHauck, May 11, 2011 IP
  11. rickyloredo

    rickyloredo Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    did you fix the problem with the Zend Optimizer i Had the same problem:confused:


     
    rickyloredo, Jun 19, 2011 IP
  12. Joshua_26

    Joshua_26 Greenhorn

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #12
    So, this is an old post but I'm hoping I may find an answer here. My problem is similar to the above issues. I've done the above suggestions to no avail.
    I am hosted by Godaddy, with IIS. I have just started playing with cakephp and have not been able to connect to my mysql database. On main page it outputs:

    Your database configuration file is present.
    Cake is NOT able to connect to the database.

    Database connection "Mysql" is missing, or could not be created.
    Selected driver is not enabled


    When I run a test script with:

    $hostname = "whatnot";
    $username = "whatnot";
    $password = "whatnot";
    try {
    $db = new PDO("mysql:host=$hostname;dbname=db_name", $username, $password);
    echo "Connected to database";
    }
    catch(PDOException $e) {
    echo $e->getMessage();
    }

    It outputs:
    could not find driver

    I have upladed a new php5.ini file in my root with the changes mentioned including the PDO stuff. Any assistance in this, or even a point in the right direction would be greatly appreciated.
     
    Joshua_26, Jun 22, 2013 IP