1
yalion
permissions troublesome!
  • 2006/8/25 15:40

  • yalion

  • Just popping in

  • Posts: 2

  • Since: 2006/8/25


On LINUX,I have installed APACHE+MYSQL+PHP
1.File HTTPD.CONFAlias /web/ "/opt/xoops-2.0.14/htdocs/"

Options All MultiViews
AllowOverride None
Order allow,deny
Allow from all

DocumentRoot "/var/www/html"

Options FollowSymLinks
AllowOverride None

2.but when I follow the install guide ,the third step,the tips like under
=====================================================
"uploads/", "cache/", "templates_c/", "mainfile.php"

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 included 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)


=======================================================
so I write an php file to test the permissions
file:testfile.php
$writeok = array("uploads/", "cache/", "templates_c/", "mainfile.php");
$title = "test file php";
$content = "
\n";
$error = false;
foreach ($writeok as $wok) {
echo "
"."../".$wok."
";
echo fileowner("../".$wok)."
";
echo filegroup("../".$wok)."
";
echo fileowner("../".$wok)."
";
echo substr(sprintf('%o', fileperms("../".$wok)), -4)."
";
echo filetype("../".$wok)."
";

if (!is_dir("../".$wok)) {


if ( file_exists("../".$wok) ) {
@chgrp("../".$wok, fileowner("../".$wok));
@chmod("../".$wok, 0666);
if (is_writeable("../".$wok)==false) {
$content .= "file ".$wok." is not writeable"."
";
$error = true;

}else{
$content .= "file ".$wok." is writeable"."
";
}
if (!is_readable("../".$wok)) {
$content .= "file ".$wok." is not readable"."
";
$error = true;

}else{
$content .= "file ".$wok." is readable"."
";
}

}
} else {
@chgrp("../".$wok, fileowner("../".$wok));
@chmod("../".$wok, 0777);
if (!is_writeable("../".$wok)) {
$content .= "dir ".$wok." is not writeable"."
";
$error = true;

}else{
$content .= "dir ".$wok."is writeable"."
";
}
if (!is_readable("../".$wok)) {
$content .= "dir ".$wok." is not readable"."
";
$error = true;

}else{
$content .= "dir ".$wok." is readable"."
";
}
}
}
$content .= "
\n";

if(! $error) {
$content .= "

"."not error"."

";


}else{
$content .= "

"." error "."

";

}

echo $content;

the result like this:

../uploads/
0
0
0
0777
dir

../cache/
0
0
0
0777
dir

../templates_c/
0
0
0
0777
dir

../mainfile.php
0
0
0
0666
file
dir uploads/ is not writeable
dir uploads/ is readable
dir cache/ is not writeable
dir cache/ is readable
dir templates_c/ is not writeable
dir templates_c/ is readable
file mainfile.php is not writeable
file mainfile.php is readable



error


who can tell me,what is wrong?

2
jensclas
Re: permissions troublesome!

Hi - I noticed your post unanswered so this response will get it back to the top - I don't understand you post other than come to the conclusion that you have not been able to change the permissions of the files you have mentioned.

The normal way is Quote:
In a XOOPS installation there are some files that need to be chmod directly after installation. This is usually achieved easily through your FTP client although it can also be done through your web server interface, such as cPanel.


(alternatively:If what you are doing is on your local machine (PC) you find the file properties and untick read only.)

The FAQ is here

So...you must be able to view and edit those files somehow and make the changes...but you lost me at the start with what you have done and you obviously know something about code...so I might just be telling you something you already know...sorry I can't be more helpful!

3
yalion
Re: permissions troublesome!
  • 2006/8/27 15:17

  • yalion

  • Just popping in

  • Posts: 2

  • Since: 2006/8/25


Thank you for your help!

I have change the permissions by using the chmod command,
ls command shows the file and dirs had been changed the permissions,0666 for the file and 0777 for the dirs.

but the XOOPS installation always shows the permissions error.

I debuged it.
and the results show that:
source code result
@chmod("../".$wok, 0666); ok,0666 for file and 0777 for dir;
is_writeable("../".$wok)==false true,can not be writeable

so I can not go to the next step XOOPS installation .

Login

Who's Online

241 user(s) are online (40 user(s) are browsing Support Forums)


Members: 0


Guests: 241


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits