sudo pear upgrade PEAR
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
$postdata = http_build_query( array( 'var1' => 'some content', 'var2' => 'doh' ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); $result = file_get_contents('http://example.com/submit.php', false, $context);
แล้วเว็บเซอร์วิสคืออะไรล่ะ ?
CentOS comes with Apache v.2.2.3 and PHP v.5.1.6 and they are easily installed via the default CentOS Package Manager ‘yum’.
The advantage of using yum (as opposed to installing via source code) is that you will get any security updates (if and when distributed) and dependencies are automatically taken care of.
A basic Apache install is very easy:
sudo yum install httpd mod_ssl
Oddly, the server does not start automatically when you install it so you have to do this by hand:
sudo /etc/init.d/httpd start
The first thing you will see is this error:
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name,
using 127.0.0.1 for ServerName
Everybody knows phpMyAdmin can export file to Excel format but phpMyAdmin just export .csv file,not real Excel file format. If you are interest in PHP programming and need to export to the real Excel format please check it out !
Example PHP export to XLS file format.
1. Create Function for XLS
function xlsBOF() {
echo pack(“ssssss”, 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
return;
}
function xlsEOF() {
echo pack(“ss”, 0x0A, 0x00);
return;
}
function xlsWriteNumber($Row, $Col, $Value) {
echo pack(“sssss”, 0x203, 14, $Row, $Col, 0x0);
echo pack(“d”, $Value);
return;
}
function xlsWriteLabel($Row, $Col, $Value ) {
$L = strlen($Value);
echo pack(“ssssss”, 0x204, 8 + $L, $Row, $Col, 0x0, $L);
echo $Value;
return;
}
This tutorial was has been tested on Ubuntu 10.04, 10.10, 11.04, 11.10, 12.04 LTS Precise Pangolin. Also tested in LinuxMint13 and works fine.
Open terminal and Type the command :install it first with
sudo apt-get install tasksel
Now to install LAMP, type the taskel command in terminal :
sudo tasksel
And select LAMP Server:
During the installation you will be asked to insert the mysql root password
Now check if php is working :
$sudo vi /var/www/info.php
and add
<?php phpinfo(); ?>
save and exit
restart apache2 ,
#sudo /etc/init.d/apache2 restart
Now open browser and type :
http://ip/info.php or http://localhost/info.php
Php is installed.
To full manage your lamp Server database, install phpmyadmin
sudo apt-get install phpmyadmin
To login to phpmyadmin, open browser and type :
http://ip/phpmyadmin or http://localhost/phpmyadmin
– ที่มา http://www.unixmen.com/install-lamp-with-1-command-in-ubuntu-1010-maverick-meerkat/