How to create custom php.ini

Home Forums BulletProof Security Pro How to create custom php.ini

This topic contains 69 replies, has 3 voices, and was last updated by  Innozant technologies 1 year, 11 months ago.

Viewing 15 posts - 46 through 60 (of 70 total)
  • Author
    Posts
  • #3191

    Young Master
    Participant

    I guess this the above code didnt work. Still my custom php.ini isn’t loaded as default configuration file. Is there any other way to resolve this?

    #3192

    AITpro Admin
    Keymaster

    Every single web host has different requirements and settings for custom php.ini files.  There are 1,000’s of different web hosts.  Trying to guess what custom php.ini requirements your particular web host has is not realistically doable.  You need to contact your web host to get this specific technical information that ONLY your web host will have for ONLY their Servers.  Have you tried looking in your Host’s help files?  Which web host do you have?

    #3194

    Young Master
    Participant

    Where are those help files found? My website is hosted at palvos technologies.

    #3195

    AITpro Admin
    Keymaster

    You would go to your web hosts website and search on their website.  If they do not have any help information about custom php.ini files then you would need to contact them for this information.  The only host that I found by that name or similar name is a Reseller Hosting company that resells Go Daddy Hosting or another host that appears to be using Nginx Servers.

    Go the BPS Pro System Info page and post your website’s information below:

    DNS Name Server:
    Server Type:
    Operating System:
    Server API:

    #3196

    Young Master
    Participant

    DNS Name Server: ns1.palvos.com
    Server Type: Apache
    Operating System: Linux
    Server API: cgi-fcgi – Your Host Server is using CGI.

    #3197

    AITpro Admin
    Keymaster

    Ok your Host uses an Nginx frontend Server and an Apache backend Server to process PHP.  I cannot find your web host’s home page so I am going to guess that your Host is a Go Daddy Reseller Host.  I am also going to guess that your Host MIGHT use (I am guessing since I cannot find your Host) the Go Daddy php/php.ini handlers.  If your host is a Go Daddy Reseller Host then it is possible that your custom php.ini file needs to be named php5.ini instead of php.ini.  As you can see it is not really smart to try and guess this information.  There are several possibilities below for Go Daddy alone and this is the same for all web hosts – you need to get the exact specific information from your web host.  php.ini files and php.ini handlers are NOT one size fits for all web hosts like .htaccess files are .  Custom php.ini files and php.ini handlers are unique and different for every single web Host and each PHP Server version.

    THESE HANDLERS MIGHT CRASH YOUR WEBSITE.  Be prepared to FTP to your website and delete your root .htaccess file if your website crashes after you add this php/php.ini handler code to your root .htaccess file.

    If your PHP Server version is PHP5.2.x and you are NOT using FastCGI…

    # GODADDY PHPINI CODE for PHP5.2.x
    AddHandler x-httpd-php5-cgi .php
    AddHandler x-httpd-php5-cgi .php5

    If your PHP Server version is PHP5.2.x and you ARE using FastCGI…

    # Godaddy phpini Code for PHP5.2.x with FastCGI
    AddHandler x-httpd-php5 .php

    If your PHP Server version is PHP5.3.x – by default Go Daddy PHP5.3.x has FastCGI enabled.

    #GoDaddy phpini Code for PHP5.3.x
    AddHandler x-httpd-php5-3 .php
    #3200

    Young Master
    Participant

    My server PHP version is 5.3.x. Yes its true my host once told me they are using nginx. So if I understood you first of all I should rename my php.ini to php5.ini then add one of the above code…Am I right? So which of the above code should I choose?

    #3201

    AITpro Admin
    Keymaster

    I have already told you in as many ways as I can think of that I am making a logical guess.  I do not know the specific php.ini handler information for your particular host.  ONLY your web host will know this specific information about their Servers.  If you decide to experiment with the logical guesses that I made then be prepared to delete your root .htaccess file because there is a chance that your website might crash if an incorrect php.ini handler is used.  If you want the definite correct php.ini handler information then you need to get that specific information from your web host about their Servers.  There are 1,000’s of possibilities so trying to guess the correct php.ini handler for your particular Server would be the hard way to do this.  Please contact your web host for this specific information for their Servers that ONLY they will have.  Thanks.

    #3202

    Young Master
    Participant

    Thanks. i will try contact them again.

    #3208

    Young Master
    Participant

    Hello…will you pls help me with this? I know its not part of this conversation but I hope u will help. The problem is that when hackers used to hack my website they used to put some files in public_ftp folder so i decide to password protect that folder. But I read an article somwhere written that u can delete that folder if you are not using it. So should I delete it or leave it password protected? Which way is better?

    #3209

    AITpro Admin
    Keymaster

    I have never heard of deleting the public_ftp folder so I can’t really offer any advice on that.  Try googling around to see what you find.  😉

    #3211

    Young Master
    Participant

    oh! Ok. I guess I will leave it password protected.

    #3374

    Young Master
    Participant

    Hello…I was finally able to get in touch with my host and they gave me this link on how to create custom php.ini

    http://www.askapache.com/php/custom-phpini-tips-and-tricks.html

    Any recommendations?

    #3376

    AITpro Admin
    Keymaster

    The standard response from a web host is to give you the exact technical information about custom php.ini files that you requested about their Servers that is specific to their Servers and not point you to some other website post on the Internet.  This tells me that your Host is guessing and they do not know that technical information about their Servers.

    So since your Host is not capable of answering your questions for whatever reason then you can try logical guesses.  The 2 most common php/php.ini handlers used are these 2.  Replace “path-to-phpini-file” with your actual Document Root path that is displayed to you on the BPS Pro System Info page.  Replace “phpinifile” with php.ini.  Either one of these will work or neither or these will work or your website will crash.  Be prepared to FTP to your website and delete your Root .htaccess file if your website crashes.  Add the first one right after the ADD A PHP HANDLER code in your root .htaccess file.  If it does not work try the second one.

    # ADD A PHP HANDLER
    # If you are using a PHP Handler add your web hosts PHP Handler below
    
    suPHP_ConfigPath /path-to-phpini-file/phpinifile
    
    or
    
    SetEnv PHPRC /path-to-phpini-file/phpinifile
    #3379

    Young Master
    Participant

    We already tried the first one but it didnt work. Let me try the second code.

Viewing 15 posts - 46 through 60 (of 70 total)

You must be logged in to reply to this topic.