越简单越好!
Freebsd安装nginx和php
发表于 2010-09-19 11:52    

1. 安装phpcd /usr/ports/lang/php5make config 这里记得选上fast-cgimake install clean

完成后,记得拷贝php的配置文件:cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini

安装扩展cd /usr/ports/lang/php5-extensions/make install clean

2. 安装nginxcd /usr/ports/www/nginxma...

查看详情已有1823次阅读  |  0次点赞  |  0个评论
centos下加php的json扩展
发表于 2010-05-11 15:37    

centos下php不会默认安装json扩展的。 而且也不能通过yum进行安装。

下载源文件包:wget http://www.aurore.net/projects/php-json/php-json-ext-1.2.1.tar.bz2解压tar xvjf php-json-ext-1.2.0.tar.bz2进入目录cd php-json-ext-1.2.0初始化PHP环境phpize报错了:phpize commend not foundPHP JSON安装之前需...

查看详情已有1896次阅读  |  0次点赞  |  0个评论
php 求两个正整数的最大公约数
发表于 2007-08-29 10:50    
求两个正整数的最大公约数采用的辗转相除法求解。以下是辗转的算法: 分别用m,n,r表示被除数、除数、余数。 ①求m/n的余数r. ②若r=0,则n为最大公约数.若r≠0,执行第③步. ③将n的值放在m中,将r的值放在n中. ④返回重新执行第①步。<br /><?phpfunction go($m,$n) { if($m<$n) {   $a = $m; &...
查看详情已有2794次阅读  |  0次点赞  |  0个评论
centos5.4下apache_php_mysql_vsftp安装
发表于 2010-05-05 13:27    

1. 开启防火墙端口:/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT/sbin/iptables -I INPUT -p tcp --dport 22822 -j ACCEPT/sbin/iptables -I INPUT -p tcp --dport 2121 -j ACCEPT/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT/etc/rc.d/init.d/iptables save/etc/init.d/iptables restart查看...

查看详情已有2139次阅读  |  0次点赞  |  0个评论
如何使用session
发表于 2006-08-16 16:02    

凡是与session有关的,之前必须调用函数session_start();为session付值很简单,如:

<?phpSession_start();$Name = "这是一个Session例子";Session_Register("Name");//注意,不要写成:Session_Register("[color=red]$Name[/color]");Echo $_SESSION["Name"];//之后$...

查看详情已有1742次阅读  |  0次点赞  |  0个评论
yardvps下CentOS5.7配置apache+php+mysql+vsftp笔记
发表于 2011-12-21 22:33    

yardvps CentOS5.7配置apache+php+mysql+vsftp笔记

 

1. 增加用户关闭root用户登陆

#useradd bevin

#passwd bevin

#vim /etc/ssh/sshd_config

把#PermitRootLogin 改成 PermitRootLogin no

 

#vim /etc/redhat-release

查看版本C...

查看详情已有2005次阅读  |  0次点赞  |  0个评论
IIS+PHP+MYSQL配置功略
发表于 2006-08-04 16:16    

   PHP的执行效率是有目共睹的,这也是我喜欢它的原因之一,和它称为绝妙搭档的Mysql以及Apache想融合,不能不惊叹其效率了。PHP更新也很快,这里列举了目前最新版本PHP4.3.2RC4(几乎没有BUG了,估计写完这篇不久后正式版就出了),和最新版本的Mysql4.0.13的安装过程。

查看详情已有1714次阅读  |  0次点赞  |  0个评论
数字三位加逗号
发表于 2006-11-23 10:53    
function num3($num){ preg_match_all("|[0-9]{1}|",$num,$getnum); $number = count($getnum[0])-1; $j = 1; $varchar = ""; for($i=$number;$i>=0;$i--){  if($j%3){   $varchar = $getnum[0][$i].$varchar;  }else{  ...
查看详情已有1750次阅读  |  0次点赞  |  0个评论
去除带<>的HTML
发表于 2006-12-01 17:09    

function delhtml($content){ $content = eregi_replace("<html>.+</head>","", $content); $content = preg_replace("/<.+?>/i","", $content); return $content; } $oneurl = "http://www.chenapp.com"; $content = file_get_contents($oneurl); echo delhtml($content);

查看详情已有1546次阅读  |  0次点赞  |  0个评论
php 下载文件
发表于 2006-08-16 12:37    

从网上看看了一些php下载文件的资料,改了改,写了这么个函数.

查看详情已有1743次阅读  |  0次点赞  |  0个评论
返回顶部 ^