PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Nov 13, 2018 12:45 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Oct 24, 2011 4:55 am 
Offline
Forum Newbie

Joined: Mon Oct 24, 2011 4:41 am
Posts: 2
I have a php page (dataup.php) which the user can upload a CSV file. When the file is uploaded, a table is created which displays the content of the CSV file. If the file is OK, the contents of the file (listed in the table) can be submitted with form buton, this button calls the same page again to inset the data into a database. The script runs fine on my development pc (windows 7 and WAMP) but when loaded onto the web host (linux), on clicking the submit button I get

Forbidden
You don't have permission to access /member/dataup.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Folder is set to 755
I have tried setting the form action=

the page name.
the full url and page name
php_self
and left blank ie. action=' '

I am assuming this is a Linux/apache issue I am not addressing correctly rather than php

Thanks in anticipation


Top
 Profile  
 
PostPosted: Mon Oct 24, 2011 9:20 am 
Offline
DevNet Resident

Joined: Sun Jun 14, 2009 3:13 pm
Posts: 1146
The apache module that is trying to write to your directory (user is called "www-data") doesn't have permission. Your development server is either less strict in enforcing file permissions (windows usually isn't strict) or www-data is in your group (775). Either you have to get your host to put www-data into your group or open up the directory's permissions (777).

FYI -- it looks like you also are missing your 404 error page.


Top
 Profile  
 
PostPosted: Mon Oct 24, 2011 9:37 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
Eric! wrote:
user is called "www-data"

Maybe. Could also be apache, or httpd, or a million other things. The correct solution is to chmod 777 the directory.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Wed Oct 26, 2011 1:30 am 
Offline
Forum Newbie

Joined: Mon Oct 24, 2011 4:41 am
Posts: 2
Thanks for the replies, it is one of the million other things.
The chmod 755 or 777 is OK.
After far too many hours fiddling I have worked out that its the form which is too long.
The CSV file uploads to create a table for the person to check, its the submission of this form that causes the problem.
Its is not the content, but the size of the form when the csv file goes from 12kb to 13kb
Still not bottomed that one though.

Thanks


Top
 Profile  
 
PostPosted: Wed Oct 26, 2011 11:27 pm 
Offline
DevNet Resident

Joined: Sun Jun 14, 2009 3:13 pm
Posts: 1146
Check:
Syntax: [ Download ] [ Hide ]
#set max post size
php_value post_max_size 20M
#set max upload file size
php_value upload_max_filesize   20M
 
I think browsers can limit the post size too, but it is usually the server that causes the problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group