openSUSE Forums > Programming/Scripting » php upload permissions/settings

Go Back   openSUSE Forums > Programming/Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read

Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 25-Sep-2008, 03:32
Explorer Penguin
 
Join Date: Jun 2008
Posts: 202
Ecky hasn't been rated much yet
Default php upload permissions/settings

I have a php upload script that would occasionally be handy, I have used it in the past but it isn't able to write files to the upload directory

The directory is writeable and the file should have permission to write there, but I seem to recall having to change or add some setting in php itself to allow php to write to disk ... and I can't remember what that was

I'm hoping someone here might have an idea as to what I need to change

Also phpinfo shows an upload limit of 2M, how can I change that?
Reply With Quote
  #2 (permalink)  
Old 25-Sep-2008, 04:14
Explorer Penguin
 
Join Date: Jun 2008
Posts: 202
Ecky hasn't been rated much yet
Default Re: php upload permissions/settings

I found these in /etc/php5/cli/php.ini

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = "/tmp"

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M


So changing the upload limit seems a snip, but I'm sure it was something other than file_uploads = On that I had to set before
Reply With Quote
  #3 (permalink)  
Old 25-Sep-2008, 07:21
ab@novell.com
Guest
 
Posts: n/a
Default Re: php upload permissions/settings

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Keep in mind that /etc/php5/cli is not for a web server's version of
PHP.... not sure if that was clear. You should also have
/etc/php5/apache2/php.ini for the web server's version. The 'cli'
version is for the command-line interface version of PHP that you can
run and probably doesn't make much sense on the 'upload' front.

Good luck.





Ecky wrote:
> I found these in /etc/php5/cli/php.ini
>
> ; Whether to allow HTTP file uploads.
> file_uploads = On
>
> ; Temporary directory for HTTP uploaded files (will use system default
> if not
> ; specified).
> upload_tmp_dir = "/tmp"
>
> ; Maximum allowed size for uploaded files.
> upload_max_filesize = 2M
>
>
> So changing the upload limit seems a snip, but I'm sure it was
> something other than file_uploads = On that I had to set before
>
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI25Bv3s42bA80+9kRAikcAJoCCWiEsOqZhK+EK9LlRp p2N9mZtwCeIYq6
KuJ3E3IfXaU2ltIWmejnYhM=
=zE65
-----END PGP SIGNATURE-----
Reply With Quote
  #4 (permalink)  
Old 25-Sep-2008, 07:50
Explorer Penguin
 
Join Date: Jun 2008
Posts: 202
Ecky hasn't been rated much yet
Default Re: php upload permissions/settings

Can't believe I was that thick!

Must've been half asleep

Though I also had to change the post_max_size = directive to match the upload_max_filesize = one

I don't know whether it's normal to have to do that or not ... but it works

Ecky
Reply With Quote
  #5 (permalink)  
Old 25-Sep-2008, 11:50
hcvv's Avatar
Wise Penguin
 
Join Date: Jun 2008
Location: Netherlands
Posts: 1,107
hcvv hasn't been rated much yet
Default Re: php upload permissions/settings

Write it down somewhere for the next time.
__________________
Henk van Velden
Reply With Quote
  #6 (permalink)  
Old 25-Sep-2008, 13:49
Explorer Penguin
 
Join Date: Jun 2008
Posts: 202
Ecky hasn't been rated much yet
Default Re: php upload permissions/settings

But half the fun is in figuring it out!
Reply With Quote
  #7 (permalink)  
Old 25-Sep-2008, 17:48
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 4,377
ken_yap is rated a glorious beacon of lightken_yap is rated a glorious beacon of lightken_yap is rated a glorious beacon of lightken_yap is rated a glorious beacon of lightken_yap is rated a glorious beacon of lightken_yap is rated a glorious beacon of lightken_yap is rated a glorious beacon of light
Default Re: php upload permissions/settings

Following the example of WETI, instead of Search for OpenSUSE Answers (SOA), just Wait for OpenSUSE Answers (WOA). It will come to you.
Reply With Quote
Reply


Bookmarks

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

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




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2