lost and found ( for me ? )

PHP5.3 : configure HTTP response code you would like to send

small tips.

# tail -1 /etc/lsb-release ;uname -ri
3.2.0-54-virtual x86_64

# apt-get install apache2 php5 libapache2-mod-php5
# a2enmod php5
# service apache2 restart

# dpkg -l php5 | tail -1
ii  php5                            5.3.10-1ubuntu3.8                 server-side, HTML-embedded scripting language (metapackage)

In case of PHP5.3, you can configure HTTP response code like this:
# cat /var/www/a.php
header('X-PHP-Response-Code: 503', true, 503);
echo date('h:i:s') . "\n";


# wget -O -
--2013-10-08 04:17:36--
Connecting to connected.
HTTP request sent, awaiting response... 503 Service Temporarily Unavailable

In case of PHP5.4 or later, you can configure like this:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.