Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Application and Web Development > PHP
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 03-18-2005, 04:43 AM   #1 (permalink)
Jason
Registered User
 
Join Date: Mar 2005
Posts: 2
Jason is on a distinguished road
using SSH to create/upload php.ini?

Hi

Please bear with me... I'm learning!

I need to change some settings in php.ini for a file uploader script to work. My host told me to connect to my home directory using Putty, and if there is no php.ini file there, create one.

I've got connected to my webspace via Putty, but not sure how to create php.ini there. Does it have to be in a particular location (the file list looks the same as when I connect with FTP - no different directories or /usr/ directory or anything)? I assume it needs to be same version as PHP installed on hosts (1&1) server?

Any suggestions welcomed!

Thanks, Jason
__________________
Jason is offline   Reply With Quote
Old 03-18-2005, 07:46 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,398
sde is on a distinguished road
that is odd, well maybe they have it set so you can't see the php.ini file over ftp. either way, do you know how to use SSH? is there a php.ini file in that directory?

most likely, you only need to add the parameters in your php.ini file that you wanted to change. i would guess that the server's php.ini file has all your default parameters, and then anything else you put in your personal php.ini file will override it.

you can use the VI editor to create your php.ini file, however, if you are not familiar with it, you might want to try just uploading one with ftp first.

to use VI, once you are logged in, and in your home directory, type this:
Code:
$ vi php.ini
(don't type the $, that is your prompt)

that should open the screen to an editor, type i to get yourself in insert mode, and then you can start typing.

to save your config, then you hold ctrl + : and then press x and <Enter>

It's pretty confusing at first, and I'm not sure why they are having you do this with Putty if you're not that familiar with SSH.

again, i would try to make the file locally in an editor first, then try to upload it via FTP. if that doesn't work, you could try to download WINSCP, which is an SSH program used to transfer files like you would with an FTP program.

once you did get the file there, it would be interesting if the new values automatically took over. i find it odd again that the host only gave you those instructions. usually, any change in the php.ini configuration has to be followed with restarting the web server.

keep us updated. good luck.
__________________
testing 1 2 3
sde is online now   Reply With Quote
Old 03-18-2005, 07:54 AM   #3 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
ctrl + : X ? huh?

hit escape to get out of insert mode. then type ":wq!" to save changes and exit vi.

the "w" writes
the "q" quits
and the "!" overrides any silly read only settings.
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 03-18-2005, 08:11 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,398
sde is on a distinguished road
oops yeah, escape, .. and yeah, ctrl + x .. (not X) .. lower case x will save it.
__________________
testing 1 2 3
sde is online now   Reply With Quote
Old 03-18-2005, 08:13 AM   #5 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
didn't know you could do it like that. nice.
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 03-18-2005, 11:07 AM   #6 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 637
DJMaze is on a distinguished road
1and1 servers run as CGI which allows you to override php.ini values.
There are also PHP extensions who control the security.

CGI is slower but allows the host to configure each website seperate and run PHP as the user instead of "nobody"
http://php.net/security.cgi-bin

Uploading a php.ini thru FTP works and should be in your root (not inside public_html, www, wwwroot, whateffa)

You can't override all PHP settings as mentioned in http://docs.php.net/en/ini.html

But why does a upload script need to have his own php.ini settings ?
The default php.ini settings are more then sufficient since it allows uploading of 2MB files max.
If you need more then 2MB you can also set it thru .htaccess
Code:
php_value upload_max_filesize 16M
__________________
DJMaze is offline   Reply With Quote
Old 03-18-2005, 11:09 AM   #7 (permalink)
Jason
Registered User
 
Join Date: Mar 2005
Posts: 2
Jason is on a distinguished road
Thank you - that worked!

I'm not sure why I couldn't just use FTP... must be something to do with my host.

Now I'm having fun trying to get my script to upload large files...

Cheers,
Jason
__________________
Jason is offline   Reply With Quote
Old 03-18-2005, 11:39 AM   #8 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,398
sde is on a distinguished road
there are 2 things that would prevent large files from uploading, .. 1, is the max file upload size, upload_max_filesize .. and the other is max_execution_time. if a file is too big, it might make your page timeout.

check out other php.ini settings here: http://codenewbie.com/php_manual_en/ini.html
__________________
testing 1 2 3
sde is online now   Reply With Quote
Old 04-28-2005, 07:15 PM   #9 (permalink)
toctaibuxu
Registered User
 
Join Date: Apr 2005
Posts: 1
toctaibuxu is on a distinguished road
Quote:
Originally Posted by Jason
Thank you - that worked!

I'm not sure why I couldn't just use FTP... must be something to do with my host.

Now I'm having fun trying to get my script to upload large files...

Cheers,
Jason
I got the same problem as you, but havent got i done, so can you point out some instructions for me.
Thanks so much.
__________________
toctaibuxu is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
jail ssh to users home directory? sde Linux / BSD / OS X 5 01-10-2004 10:09 AM
include_path in php.ini revolution PHP 2 02-08-2003 06:34 PM


All times are GMT -8. The time now is 11:47 AM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle