≡ Menu

PHP

I‘ve brand new Ubuntu Linux server (Apache + PHP5 FastCGI + Lighttpd image only server) installed for my wordpress, mediawiki and vBullietin software. I can load forntpage of all software but user cannot edit any wiki pages or post anything and I get the following error in log file:

PHP Fatal error: Allowed Memory Size of 20971520 Bytes exhausted (tried to allocate 131072 bytes) in /usr/share/mediawiki/includes/OutputHandler.php on line 81

How do I fix this problem?
[click to continue…]

Sysadmin because even developers need heroes!!!

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…]

Explain: php_self or $_SERVER[‘PHP_SELF’] Usage

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

Q. I’m trying to upgrade my PHP version from 5.2.6 to 5.2.8 using portupgrade command. But I’m getting following errors:

*** Error code 1

Stop in /usr/ports/lang/php5.
*** Error code 1

Stop in /usr/ports/lang/php5.
*** Error code 1

Stop in /usr/ports/lang/php5.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade.42275.0 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=php5-pcre-5.2.6_2 UPGRADE_PORT_VER=5.2.6_2 make reinstall
—> Restoring the old version
pkg_add: warning: package ‘php5-pcre-5.2.6_2’ requires ‘php5-5.2.8’, but ‘php5-pcre-5.2.6_2’ is installed
** Fix the installation problem and try again.
[Updating the pkgdb in /var/db/pkg … – 62 packages found (-0 +1) . done]
** Listing the failed packages (-:ignored / *:skipped / !:failed)
! lang/php5 (php5-pcre-5.2.6_2) (install error)

How do I fix this problem and upgrade php5-pcre?
[click to continue…]

PHP: Stop Notice and Variable Warnings in Error Log Files

I‘m using PHP error logging in place of error displaying on production web sites. However, I do not want to see error messages about the use of uninitialized variables. I’d like to see all critical errors, except for notices and coding standards warnings. How do I disable error messages?
[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…]

PHP Find / Extract Substrings

Q. How do I find out if a string stored in a variable contains a particular substring using PHP? How do I find out (extract) first 5 character of a particular string using Apache and PHP?
[click to continue…]

PHP Send Email

Q. How do I send an email using PHP and Apache webserver under Linux / UNIX operating systems? How do I send email from a PHP Script?
[click to continue…]

PHP Not Accepting <? Tag; Only Accepting <?php and <script> Tag

I am using PHP along with the latest version of Apache web-server. Only <?php and <script> tags are recognized by my LAMP setup. Many of my scripts are broken. How do I allow the <? tag also?
[click to continue…]

FreeBSD: Install PHP xcache Opcode Cacher

Q. How do I install and configure xcache under FreeBSD operating systems for Apache, lighttpd or ngnix web server?
[click to continue…]