In Linux, I have installed Apache + MySQL + PHP
Set the following path in the httpd. conf file:
Alias/web/"/opt/xoops-2.0.14/htdocs /"
<Directory "/opt/xoops-2.0.14/htdocs/">
Options all Multiviews
AllowOverride none
Order allow, deny
Allow from all
</Directory>
DocumentRoot "/var/www/html"
<Directory/>
Options followsymlinks
AllowOverride none
</Directory>
"Uploads/", "cache/", "templates_c/", "mainfile. php"
Both the 777 and 666 attributes are set in the directory.
However, no matter how it is modified, the following error occurs during the installation of xoops:
Http: // 127.0.0.1/web/install/index. php
Checking file and directory permissions ..
Directory uploads/is not writable.
Directory Cache/is not writable.
Directory templates_c/is not writable.
File mainfile. php is not writable.
In order for the modules encoded in the package to work correctly, the following files must be writeable by the server. please change the permission setting for these files. (I. e. 'chmod 666 file_name 'and 'chmod 777 dir_name' on a Unix/Linux server, or check the properties of the file and make sure the read-only flag is not set on a Windows Server)
The old prompt shows that the permission is insufficient. What's wrong?
Yesterday I wrote a piece of PHP code to test the above problems. The Code is as follows:
<? PHP
$ Writeok = array ("uploads/", "cache/", "templates_c/", "mainfile. php ");
$ Title = "test file PHP ";
$ Content = "<Table align = 'center'> <tr> <TD align = 'left'>/N ";
$ Error = false;
Foreach ($ writeok as $ wok ){
Echo "<br/>". ".../". $ wok. "<br/> ";
Echo fileowner (".../". $ wok );
Echo substr (sprintf ('% o', fileperms ("../". $ wok),-4 );
Echo filetype ("../". $ wok );
If (! Is_dir ("../". $ wok )){
If (file_exists (".../". $ wok )){
@ Chmod (".../". $ wok, 0666 );
If (! Is_writeable (".../". $ wok )){
$ Content. = "mainfile. php is not writeable". "<br/> ";
$ Error = true;
Echo $ error;
} Else {
$ Content. = "mainfile. php is writeable". "<br/> ";
}
}
} Else {
@ Chmod (".../". $ wok, 0777 );
If (! Is_writeable (".../". $ wok )){
$ Content. = "dir". $ wok. "is not writeable". "<br/> ";
$ Error = true;
Echo $ error;
} Else {
$ Content. = "dir". $ wok. "is writeable". "<br/> ";
}
}
}
$ Content. = "</TD> </tr> </table>/N ";
If (! $ Error ){
$ Content. = "<p>". "Not error". "</P> ";
} Else {
$ Content. = "<p>". "error". "</P> ";
}
Echo $ content;
?>
The returned result is strange. The result is as follows:
../Uploads/
00777dir1
../Cache/
00777dir1
../Templates_c/
00777dir1
../Mainfile. php
00666file1
Dir uploads/is not writeable Dir Cache/is not writeable Dir templates_c/is not writeable Mainfile. php is not writeable |
Error
The directory attribute is 0777 and the file attribute is 666. But when the is_writeable () function is executed, it cannot be written? What is the problem? Is PHP's user permission?