Hi I have a conflict, I couldn't write from web the visit counter, the code is:
<?php
$handle = fopen("counter.txt", "r");
$fileip = file_get_contents("counter.txt");
if(!$handle){
echo "Archivo bloqueado";
}
else {
$counter=(int )fread($handle,20);
fclose($handle);
$counter++;
echo "<b><font face='arial' size='4' color='#C10434'>VISITAS: ". $counter . " <br>" ;
$handle= fopen("counter.txt", "w" ) ;
fwrite($handle,$counter) ;
fclose ($handle) ;
}
?>
I found that probably the problem is Selinux Permissions: https://lists.centos.org/pipermail/cent ... 15653.html
Probably I will execute: chcon -R -t httpd_sys_rw_content_t /var/www/html BUT the web server has another applications like joomla and perl.
Please will you help to find the solution?
Thanks a lot.
I couldn't write in file
Re: I couldn't write in file
Move your file somewhere that selinux does allow the web server to write.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: I couldn't write in file
Move your file somewhere that selinux does allow the web server to write.
Thanks a lot, I moved and the counter grew.
Thanks a lot, I moved and the counter grew.