Re: postgresql csv import
[email protected] (Ashley Sheridan)
| Newsgroups | php.general |
|---|---|
| Message-ID | <[email protected]> |
On 22/09/2021 18:46, ourdiaspora wrote: >>> The postgresql role created and assigned permissions in same group as normal user account. Able successfully to access database. The php files report successful condition of database, to imply appropriate permissions >> That's database permissions, I was speaking of file permissions, which > are completely different. What operating system are you hosting this on, > as that changes how you check file permissions. > > GNU/Linux debian. The database role and file permissions were assigned membership of the same permissions group as a normal user. On Linux there's not really such a thing as a "normal" user. Your web server will typically be running under the apache or www2 user (or similar). The temporary upload directory (usually /tmp but you'd have to check your php.ini or phpinfo() for this) would need to have permissions that allow the web server user to write to it. This is usually done by adding the web server user to the group that the temp directory belongs to (unless it's root, then never do that), or the worst case scenario (which should be fine for local development) is to give 755 permissions to the temp directory. Again, be careful, and proceed with each step one at a time, messing around with file permissions can go wrong if you don't know what you're doing. I believe that normal permissions on this directory are fully writeable by any user, so it may be the case that your PHP settings have the wrong directory or are otherwise blocking the file. > >>> The html form shows the file, to suggest path validity >> No, that's the PHP script, that's not the upload directory. On a lot of Linux systems this is /tmp, but it will vary from system to system. > Sorry, misunderstood; this directory is in the home directory of the normal user. The database role is a member of the group for the normal user. Again, there's no such thing as a "normal" user. Also, I think you're confusing the two directories here. In order for uploads to happen, the web server first processes uploaded files by putting them in a temporary directory. Your code is then responsible for moving the file to it's more permanent location. Your script appears to be failing at the point the file is meant to go to the temporary upload directory, so it doesn't matter about the directory you plan to move the file to, there's nothing to move. -- Ashley Sheridan https://www.ashleysheridan.co.uk