icon Learn how to get the most out of Surmunity - read our forum tips here! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » PHPsuexec » How to create a php.ini file

PHPsuexec Information and tips

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old March 13th, 2006, 8:53 AM   #1 (permalink)
バタフライ
 
Kayla's Avatar
 
Joined in May 2003
Lives in Orlando
23,560 posts
Gave thanks: 885
Thanked 706 times
Blog Entries: 28
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
Kayla is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 17th, 2006, 2:29 PM   #2 (permalink)
I'm Dope as Crack
Resident.
 
David's Avatar
 
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.
David is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 17th, 2006, 4:10 PM   #3 (permalink)
DemonicAngel
Super #1
 
twirp's Avatar
 
Joined in Aug 2004
Lives in Wherever The World Takes Me
Hosted on Pass76
1,726 posts
Gave thanks: 23
Thanked 31 times
Blog Entries: 12
php.ini (php4)
php.ini (php5)
That's the default php.ini. When making your own, those are the different values you can change. ; is a comment
Hope this helps anyone.
__________________
You wear Vans so high school kids will think that you can skate. He wears Vans because he can skate. TwiRp wears Vans because they were on sale. Pass76 wants Vans.
twirp is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old November 22nd, 2006, 10:05 AM   #4 (permalink)
Registered User
Seasoned Poster
 
echo's Avatar
 
Joined in Nov 2004
Lives in The Crazy Diamond Mine
Hosted on Pass17
40 posts
Gave thanks: 5
Thanked 0 times
Blog Entries: 1
Exclamation

Quote:
Originally Posted by twirp View Post
php.ini (php4)
php.ini (php5)
That's the default php.ini. When making your own, those are the different values you can change. ; is a comment
Hope this helps anyone.
Hi
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
echo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old November 22nd, 2006, 11:47 AM   #5 (permalink)
H
after g, before i
Super #1
 
H's Avatar
 
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.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks H for this great post!
echo (November 22nd, 2006)
Old January 9th, 2007, 7:45 PM   #6 (permalink)
Registered User
Seasoned Poster
 
m0nty's Avatar
 
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
m0nty is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 9th, 2007, 8:25 PM   #7 (permalink)
Surpass Fan
Excelling Contributor
 
cowboy's Avatar
 
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
921 posts
Gave thanks: 2
Thanked 91 times
Quote:
Originally Posted by m0nty View Post
how do you set php directives in php.ini when using php 5?
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)?
cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 9th, 2007, 10:36 PM   #8 (permalink)
Registered User
Seasoned Poster
 
m0nty's Avatar
 
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
m0nty is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 9th, 2007, 11:11 PM   #9 (permalink)
H
after g, before i
Super #1
 
H's Avatar
 
Joined in Jul 2004
Hosted on Gojira
7,735 posts
Gave thanks: 40
Thanked 117 times
m0nty. Surpass is in the process of turning both off.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On