Bug 1262481
Summary: | error mkdir from php | ||
---|---|---|---|
Product: | [Community] GlusterFS | Reporter: | Thomas <t.aichinger> |
Component: | scripts | Assignee: | bugs <bugs> |
Status: | CLOSED EOL | QA Contact: | |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 3.5.2 | CC: | bugs, t.aichinger, vbellur |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-06-17 15:57:47 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Thomas
2015-09-11 20:40:23 UTC
Could you confirm that you made the directory where this PHP script is writing, is writeable by the Apache user? You could try to "chmod ugo+rwx /path/to/mountpoint/parent/of/php/dir". Also check if this is not blocked by SElinux or other security frameworks. Apache has full write access there are absolutely (100%) no restrictions. This php code works perfect (but uses system calls): system("mkdir testdir"); $d = dir("."); while(($etg = $d->read()) !== false) { echo htmlspecialchars($etg) . "<br />"; } $d->close(); system("rmdir testdir"); I think this is related with the way php is creating a file or directory. BTW - same problem with creating and removing files. Could you post the output of "ls -ld /parent/dir/where/php/creates/a/dir" and the error messages that the script gets or logs somewhere? ww1:/ # ls -ld /_www drwxrwxrwx 16 wwwrun users 4096 Sep 11 22:43 /_www ww1:/ # ls -ld /_www/www.e4e.at/ drwxrwxrwx 2 wwwrun users 87 Sep 11 23:14 /_www/www.e4e.at/ ww1:/_www/www.e4e.at # l total 8 drwxrwxrwx 2 wwwrun users 87 Sep 11 23:14 ./ drwxrwxrwx 16 wwwrun users 4096 Sep 11 22:43 ../ -rw-rw-rw- 1 wwwrun users 1035 Sep 11 21:08 _index.html -rw-rw-rw- 1 wwwrun users 212 Sep 11 22:43 index.php -rw-rw-rw- 1 wwwrun users 64 Sep 11 21:07 robots.txt -rw-rw-rw- 1 wwwrun users 183 Sep 11 23:14 test.php -rw-rw-r-- 1 wwwrun users 173 Sep 11 23:09 test.txt ww1:/_www/www.e4e.at # cat index.php <?php $outdir = 'tom'; mkdir($outdir, 775, true); if(is_dir($outdir) == true){ echo "gefunden"; } Can you please try mounting glusterfs with enable-ino32 and check if the problem persists? thanks. gluster volume set gv0 nfs.enable-ino32 on does not help, still the same problem php can not create directory Can you please try mounting your volume as mount -t glusterfs -o enable-ino32 ... and check again? thanks. Yes, this is much better now. php can create directories now Altough php still can't read directories <?php echo "-----------<br />"; echo "read dir<br />"; echo "-----------<br />"; $d = dir("."); while (($eintrag = $d->read()) !== false) { echo htmlspecialchars($eintrag) . "<br />"; } $d->close(); ?> ist not working on glusterfs vol but reads on ext4 vol same code, same server, two virtualhosts in apache, one rootdoc on glusterfs the other on ext4 What is the filesystem that you are using for gluster bricks? If it is ext4, can you please try if readdir works fine with a xfs based gluster brick? Thanks. This bug is getting closed because the 3.5 is marked End-Of-Life. There will be no further updates to this version. Please open a new bug against a version that still receives bugfixes if you are still facing this issue in a more current release. |