• The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

How can I make this counter work in Plesk?

C

Clark

Guest
This is a simple script I used previously on a server running with Cpanel. I have not been able to make it work yet under Plesk.

I have the count.php file located in a directory of my site like
mysite.com/forum/count/count.php

It takes the message numbers, checks if a file name of that number exists in the count directory and writes and increments the counter for each file.

It is called as an include from a message located on my site at an address like mysite.com/forum/messages/12345.php

Here is the counter code. The test $number I am passing to the counter is 777.

Code:
<?
if (file_exists("$number")) {
        $fd = fopen("$number", "r"); 
        $num =  fread($fd, filesize("$number")); 
        fclose($fd);
}
else {
        $fd = fopen("$number", "w+"); 
        $num = "0"; 
        fclose($fd);
}

        $fd = fopen("$number", "w"); 
        $read = $num + 1; 
        echo "$read"; 
        fwrite($fd, $read); 
        fclose($fd); 
?>

Here are the error messages I receive:

Code:
PHP Warning:  fopen(777): failed to open stream: Permission denied in /home/httpd/vhosts/mysite/httpdocs/forum/count/count.php on line 12

PHP Warning:  fclose(): supplied argument is not a valid stream resource in /home/httpd/vhosts/mysite/httpdocs/forum/count/count.php on line 14

PHP Warning:  fopen(777): failed to open stream: Permission denied in /home/httpd/vhosts/mysite/httpdocs/forum/count/count.php on line 17

PHP Warning:  fwrite(): supplied argument is not a valid stream resource in /home/httpd/vhosts/mysite/httpdocs/forum/count/count.php on line 20

PHP Warning:  fclose(): supplied argument is not a valid stream resource in /home/httpd/vhosts/mysite/httpdocs/forum/count/count.php on line 21
 
Back
Top