php script

One of my php script called setoptions.php is hosted on my new vps server. However, it is not working so I setup php error log as described here and, and I see the following warning repeated in my log file:

PHP Warning: fread(): Length parameter must be greater than 0 in /var/www/html/scripts/setoptions.php on line 311

The line no # 311 is as follows in my php script:
$fname = 'myappconfig.php';
$content = fread($fhandle,filesize($fname));

How do I fix this problem under Unix/Apache/php5 server?

{ 1 comment }

I own a small business website. However, bots started to abusing my forms such as contact.php. How do I stop bots bots from abusing my site? How do I tell if PHP form is submitted by a person or a script?

{ 26 comments }

Can you explain usage of predefined variables called $_SERVER[‘PHP_SELF’]?

{ 4 comments }

Q. How do I redirect my domain name using a php server side scripting under Apache web server?

{ 2 comments }

Q. How do I configure PHP as FastCGI under FreeBSD Nginx webserver?

{ 10 comments }

Q. I’m using PHP along with latest version of Apache. Only <?php and <script> tags are recognized. Many of my scripts are broken. How do I allow the <? tag also?

{ 7 comments }

I‘ve nicely written PHP script that I’d like to run as a cron job. I’m using CentOS 4.5 as server with Apache web server. How do I setup a PHP script as a cron job?

{ 15 comments }