-
PHPPlatform/WAS 2014. 11. 26. 18:15
$ rpm -qa | egrep "^(httpd|php|mysql)" | sort -n
# yum install [httpd mysql mysql-server php] php-mysql
# service httpd status
# service mysqld status
$ php -v
# service httpd (start|restart)
# chkconfig --list | egrep "mysqld|httpd"
# chkconfig mysqld on
$ php -r 'echo "Hello World\n";'
## /etc/php.ini
short_open_tag = (Off|On)
display_errors = (On|Off)
register_globals = (Off|On)
extension_dir="C:\Program Files (x86)\PHP\ext"
[Date]
date.timezone = Asia/seoul
[PHP_MYSQL]
extension=php_mysql.dll
# cp php.ini php.ini.default
# service httpd restart
<?php
echo 'Hello';
?>
<?php
$db = new mysqli("localhost", "root", "P@ssw0rd", "test");
if ($db->connect_errno) die("Connect failed: ".$db->connect_error);
$result = $db->query("SHOW DATABASES;");
echo "<xmp>";
while ($row = $result->fetch_object()) print_r($row);
echo "</xmp>";
$result->close();
$db->close();
?>
참조 사이트: