Logan Best
Logan Best

Reputation: 501

PHP - uploading to dir outside docroot

I have nginx+php-fastcgi running on my server and I"m trying to allow a php script in /var/www/contest to upload to a non-public directory located at /var/www/private/uploads.

I've tried changing the include path in php.ini but all I get is "No input file specified." when I try to view the page in /contest that uploads the pics.

Upvotes: 0

Views: 230

Answers (2)

atma
atma

Reputation: 875

At first, check your upload_tmp_dir in PHP_INI system and set to right path. Check write permissions for it. Use move_uploaded_file to store files manually in right place.

Upvotes: 0

miki
miki

Reputation: 695

your php script will run as some user. give that user write access to /var/www/private/uploads.

Upvotes: 0

Related Questions