≡ Menu

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?
[click to continue…]

PHP Add Captcha Protection To Web Forms

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

Can you explain usage of predefined variables called $_SERVER['PHP_SELF']?
[click to continue…]

Domain Redirection Using a PHP Script

Q. How do I redirect my domain name using a php server side scripting under Apache web server?
[click to continue…]

FreeBSD: Nginx FastCGI PHP Configuration

Q. How do I configure PHP as FastCGI under FreeBSD Nginx webserver?
[click to continue…]

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?
[click to continue…]

I've been trying to migrate my webblogs using WordPress inbuilt import facility. I've exported current blog as a xml file and downloaded to my desktop. Next I navigated to my new blog's admin area and clicked on Manage > Import. However import failed after importing 50-60% posts only.

I went through Apache and PHP log files and I realized that the script was timed out. How do I fix this problem under Linux / UNIX?
[click to continue…]