|
|
#1 (permalink) |
|
バタフライ
Joined in May 2003
Lives in Orlando
|
How to create a php.ini file
Q. How do I create a php.ini file?
A. To create a php.ini file, just open up a TEXT editor (such as Notepad, Editplus, Wordpad - or even use the Cpanel FileManager option to create a new file - do not use a word processor!), add in the lines you need and save the file. You can name the file whatever you wish when saving. Once done, upload the file to the directory where the script you're using is being accessed. Rename it to php.ini if you changed it on save (some clients use a .txt extension so the ftp client will not be confused between ASCII and BINARY). Q. But won't somebody be able to pull up the php.ini file in their web browser? A. You can set the file permissions to "600" (which will allow you to read and write to the file, but will block Apache from displaying it) and as an added security measure you could add the following in a .htaccess file (such as in /public_html/.htaccess) to block access: Order deny, allow
__________________
|
|
|
|
|
|
#2 (permalink) |
|
I'm Dope as Crack
Resident.
Joined in Mar 2004
Lives in Asheboro, NC
Hosted on Pass 7
13,031 posts
Gave thanks: 7
Thanked 29 times
|
Ooo. Good tip at the end there.
__________________
http://search.ebay.com/_W0QQfgtpZ1QQ...heborocreative |
|
|
|
|
|
#3 (permalink) |
|
DemonicAngel
Super #1
Joined in Aug 2004
Lives in Wherever The World Takes Me
Hosted on Pass76
|
|
|
|
|
|
|
#4 (permalink) | |
|
Registered User
Seasoned Poster
Joined in Nov 2004
Lives in The Crazy Diamond Mine
Hosted on Pass17
|
Quote:
![]() The links the the example php.ini files above now return a 404 error. Could someone please post and/or link to more php.ini file examples? I haven't had much luck finding the information I need to put in my php.ini files. (Support is currently working on this for me.) But it would be lovely if we could have some examples here in the forum. And I'm sure we can add them to the wiki, as well. Thanks ![]()
__________________
I exist here. I must learn to walk in this world. Pass17 echoing.org Bronze Reseller
|
|
|
|
|
|
|
#5 (permalink) |
|
after g, before i
Super #1
Joined in Jul 2004
Hosted on Gojira
7,735 posts
Gave thanks: 40
Thanked 117 times
|
If you're using SSH, go to the folder you want to create the php.ini file. Then type "touch php.ini". This will create a blank php.ini file. Next type "pico php.ini" (I prefer pico, but you can use whatever editor you want), do what you need to do, output the file and off you go.
|
|
|
|
| This user thanks H for this great post! | echo (November 22nd, 2006) |
|
|
#6 (permalink) |
|
Registered User
Seasoned Poster
Joined in Jun 2005
Lives in Derbyshire/UK
Hosted on sh106
90 posts
Gave thanks: 1
Thanked 1 Time in 1 Post
|
how do you set php directives in php.ini when using php 5?
i have php.ini files in my site (it's hosted on a shared reseller server) serva. example: register_globals = 0 allow_url_fopen = 0 session.use_only_cookies = 1 post_max_size = 64M upload_max_filesize = 10M the above works fine when i'm using php 4 as default. but as a couple of new modules i now use etc require PHP 5, i am now using php5. altho i have not renamed all the extensions to .php5 (couldn't be bothered as it's too much trouble) instead i use .htaccess with the following > RewriteEngine On AddHandler application/x-httpd-php5 .php but after doing that the php settings in the php.ini file no longer work. also i have noticed, that since changing to use php5, i now have to set folder permissions to 777 in order for the script to be able to write to those folders.. on php4, i can set them to 755 (which is more secure)
__________________
Smartfactory.ca Module Development Team. ImpressCMS.org Impress CMS Project: Making a lasting impression! surpass server: SH106 |
|
|
|
|
|
#7 (permalink) |
|
Surpass Fan
Excelling Contributor
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
921 posts
Gave thanks: 2
Thanked 91 times
|
PHP4 and PHP5 do not get along together on the same server, even though they will tolerate each other somewhat, both will not run together as CGI.
You could try .htaccess php5 directives in the sole folder as the calling script, or, better by using ini_set() within your script at the beginning. The vulnerability of letting PHP run as a runaway "nobody/anybody" state (when write permissions are required), not only leaves your site in jeopardy, but the entire server as well. PHP5 in these conditions should be used only as a last resort. .
__________________
Where would you be if you were at the highest court in the land (US)? |
|
|
|
|
|
#8 (permalink) |
|
Registered User
Seasoned Poster
Joined in Jun 2005
Lives in Derbyshire/UK
Hosted on sh106
90 posts
Gave thanks: 1
Thanked 1 Time in 1 Post
|
cheers m8.. didn't think it would be that easy to sort..
speaking arrogantly: can't surpass just set register_globals & allow_url_fopen off as default (especially regarding PHP 5 being as php.ini files don't work with it)if users then need register globals on &or fopen enabled, then they should be the ones that need the php directives lol (y make us security conscious people be the ones to suffer) it would save us all the hassle and is much more secure anyway. scripts that don't work with them disabled should be rewritten to work by the developers.. it would surely encourage them to write their scripts properly and safer.
__________________
Smartfactory.ca Module Development Team. ImpressCMS.org Impress CMS Project: Making a lasting impression! surpass server: SH106 |
|
|
|