CentOS 5.2 下用Yum安装Apache+PHP+MySQL环境
1.
CentOS 5.2 下用Yum安装Apache+PHP+MySQL环境
2009-04-03 23:47
Fedora 8下用Yum安装Apache+PHP+MySQL环境
fedora8 用yum来管理安装Apache+PHP+Mysql的基本安装。
1. 安装Apahce, PHP, Mysql, 以及php连接mysql库组件。
yum -y install httpd php mysql mysql-server
php-mysql
centos安装php插件就是yum install php-*
yum install php-gd 安装图形支持
也可以通过光驱iso安装
mount /dev/cdrom /mnt挂载光驱到mnt
rpm -ivh /mnt/centos/httpd ****.rpm
安装ISO里的包
测试环境
rpm -qa |grep mysql
rpm -qa |grep httpd
rpm -qa |grep php
2. 配置开机启动服务
/sbin/chkconfig httpd on
[设置apache服务器httpd服务开机启动]
/sbin/chkconfig --add mysqld
[在服务清单中添加mysql服务]
/sbin/chkconfig mysqld on
[设置mysql服务开机启动]
/sbin/service httpd start
[启动httpd服务,与开机启动无关]
/sbin/service mysqld start
[启动mysql服务,与开机无关]
3.设置mysql数据库root帐号密码。
mysqladmin -u root password 'newpassword'
[引号内填密码]
4. 让mysql数据库更安全
mysql -u root -p
mysql> DROP DATABASE
test; [删除test数据库]
mysql> DELETE from mysql.user WHERE user =
''; [删除匿名帐户]
mysql> FLUSH
PRIVILEGES; [重载权限]
5. 按照以上的安装方式, 配置出来的默认站点目录为/var/www/html/
新建一
相关文档:
PHP批量取得checkbox的值
1、命名
<input type='checkbox' name='checkbox[]' value=$dwmyrow[banzhu] />
2、使用
当计划当作sql指令的一部分时:如果参与控制的字段是数值型的,则
if(! empty($_POST['checkbox'])) {
$expr = join(",", $_POST['checkbox']);
$sql = "select * from tbl_name where field in ......
PHP4:
<?
$sample1 = new StdClass();
$sample1->name = "Hasin";
$sample2 = $sample1;
$sample2->name = "Afif";
echo $sample1->name;
?>
In PHP4 it works differently; it will output Hasin, as both are different from
each other.
PHP5:
<?
$sample1 = new StdClass();
$ ......
If you want to put some big table in the pdf file, you may got the layout messy. One way to solve the problem is to change the paper size. In "includes/cpdf_adapter.cls.php", Change the size you used in the array to whatever you want.
One tip: Replace Url into Clickable link.
$tex ......
<?php
$conn = "what's the fucking";
?>
<mce:script type="text/javascript"><!--
var innn = "<?php echo $conn ?>";
document.write(innn);
// --></mce:script>
php和JavaScript的变量不能通用,但当我们需要在一个页面使用同一个变量时,可以 ......
在实际的程序开发中,执行字符串替换操作是一件非常经常的事,对str_replace函数的实用也会非常频繁。
这段时间在看《PHP和MySQL Web开发》一书看到str_replace讲解,一段小提示写到:可以为str_replace的三个都使用数组传入,但讲解比较简单,于是决定自己 ......