记录生活
标签 Tag : php

godaddy+qeephp的rewrite配置

<Category: PHP> 发表评论

不知道什么原因,godaddy服务器抽风,php环境变量的doc_root及temp变量的路径和实际的路径对应不上,另外rewrite也出问题。
N年不玩qeephp,折腾了一会,记录一下:

根目录修改php.ini

register_globals = off
allow_url_fopen = off
 
expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
 
[Zend]
zend_extension=/usr/local/zo/ZendExtensionManager.so
zend_extension=/usr/local/zo/4_3/ZendOptimizer.so
 
 
cgi.fix_pathinfo=0
doc_root=/home/content/k/a/n/your_app/html
DOCUMENT_ROOT=/home/content/k/a/n/your_app/html
 
TMPDIR=/home/content/k/a/n/your_app/tmp 
PHPRC=/home/content/k/a/n/your_app/html 
TEMP=/home/content/k/a/n/your_app/tmp 
TMP=/home/content/k/a/n/your_app/tmp

qeephp配置文件/config/environment.yaml里
url_mode确保为rewrite

dispatcher_url_mode:            rewrite

站点根目录.htaccess

# Mod Rewrite
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#RewriteRule ^(.*)$ index.php/$1
#Fix Rewrite
Options -Multiviews

本文来自: godaddy+qeephp的rewrite配置

qeephp邮件处理helper插件

<Category: Web> 发表评论

qeephp_email_plugin
阅读这篇文章的其余部分 »

本文来自: qeephp邮件处理helper插件

lnmp、mono与asp.net环境安装

<Category: Linux, 小道消息> 发表评论

kloxo虽然比较强大,但是太耗资源,有些东西不一定需要,所以决定还是装LNMP。另外需要调试下ASP.NET程序,把MONO也装上了,使用fastcgi、mysql和nginx。

1.安装lnmp

 wget http://soft.vpser.net/lnmp/lnmp0.3.tar.gz
 tar vxzf lnmp0.3.tar.gz
  cd lnmp0.3
 ./centos.sh

asp.net支持
2.编译安装mono 2.0

wget http://ftp.novell.com/pub//sources//mono-2.0.tar.bz2
tar jvxf -2.0.tar.bz2
cd -2.0
./configure --prefix=/usr/local
make
make install

3.安装完毕后可以通过“mono -V”查看mono版本

[root@medcl mono-2.0]# mono -V
Mono JIT compiler version 2.0 (tarball)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none

4.安装fastcgi-mono-

yum  install subversion
svn co http://mono-soc-2007.googlecode.com/svn/trunk/brian/FastCgi/ fastcgi-mono-server
cd fastcgi-mono-server/
./autogen.sh
make
make install

 

下面的方法经测可用
#yum groupinstall Mono
But I noticed the version of Mono I installed is 1.2.4, seems that the lastversion of mono (2.4.2.3) is not in the CentOS package repositories.
Then I tried to find the last version distribution from Mono Home page and google, but no result, So I had to download the source code and compile it all by my self.
After some attempts, I got the following steps to compile and install the last version Mono on my CentOS 5.2 VPS host,
1.prepare the compile environment,
# yum install gcc bison pkgconfig glib2-devel gettext make

2.Go to this page and download the last version Mono(in my case, mono-2.4.2.3.tar.bz2),
#wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.4.2.3.tar.bz2

3.Extract the downloaded file,
# tar jxvf mono-2.4.2.3.tar.bz2

4.Change to the newly created directory,
# cd mono-2.4.2.3

5.I put my built packages in /opt so, run the following command to build mono,
# ./configure –prefix=/opt/mono; make; make install
6.Update ~/.bash_profile,

#echo export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH>>~/.bash_profile
#echo export PATH=/opt/mono/bin:$PATH>>~/.bash_profile
#source ~/.bash_profile

7. Test it,
#mono -V
and I got the output:

Mono JIT compiler version 2.4.2.3 (tarball Thu Oct 22 06:42:24 MSD 2009)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none

Great, I got it.
I think I’d better put all script I used in one place,

mkdir ~/software
yum install gcc bison pkgconfig glib2-devel gettext make
wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.4.2.3.tar.bz2
tar jxvf mono-2.4.2.3.tar.bz2
cd mono-2.4.2.3
./configure –prefix=/opt/mono; make; make install
echo export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH>>~/.bash_profile
echo export PATH=/opt/mono/bin:$PATH>>~/.bash_profile
source ~/.bash_profile
mono -V
cd ..
rm -rf mono-2.4.2.3

references,
Mono Home Page
[HOWTO] Install Mono 2.4 on CentOS 5.3

nginx配置server节点之后
fastcgi-mono-server2 /socket=tcp:9000 &

重启nginx:kill -HUP `cat /usr/local/nginx/logs/nginx.pid`

asp.net探针截图

本文来自: lnmp、mono与asp.net环境安装

jetty with php

<Category: Java> 1 条评论

http://quercus.caucho.com/

楠哥服务器上不让搞php,山人自有妙计,借助Quercus,纯100%java编写,在java服务器上也可以跑php程序了,哈哈。

最新版是Quercus 4.0.3,下载地址:

4.0.3 .war src源文件 2010-01-11

使用:   最简单直接的方法,就是解压放Quercus压缩包到java应用服务器,如Tomcat的wepapp目录,其他的配置同Tomcat,tomcat配置在此不说了,删除目录里不需要的image目录什么的,然后在里面直接放你的php程序就可以了。 

   推荐jetty,这里下载集成php的jetty(其实啥都没干,就扔了个目录进去了,哈哈),无需等待和配置,解压执行,下载这里http://www.box.net/shared/x0spxxpi4n

截图:

1.启动默认显示Quercus的欢迎界面,提示一切顺利,真是谢谢啊

Capture1

2.搞个自带的探针瞧瞧

探针
阅读这篇文章的其余部分 »

本文来自: jetty with php

关于phpcms首页缩略图显示不了的bug

<Category: 问题> 发表评论

前几天碰到phpcms的一个bug,主要问题是当文章缩略图来源为网络图片而非本地图片时,显示警告造成首页幻灯片显示不正常,错误提示如下:

Warning: getimagesize(x:/Hosting/xxx/html/x.cn/http://www.xxx.com/upimg/allimg/090508/1148140.png) [function.getimagesize]: failed to open stream: Invalid argument in x:\Hosting\xxx\html\x.cn\include\global.func. on line 768
screenshot1
解决办法,修改include\globa.func.php的764行左右,修改下这个函数,如下:

function thumb($imgurl, $width = 100, $height = 100 ,$autocut = 1, $smallpic = 'images/nopic_small.gif')
{
	global $image;
	if(empty($imgurl)) return $smallpic;
	list($width_t, $height_t, $type, $attr) = getimagesize(PHPCMS_ROOT.$imgurl);
	if($with>=$width_t || $height>=$height_t) return $imgurl;
	if(!extension_loaded('gd') || strpos($imgurl, '://')) return $imgurl;
	if(!file_exists(PHPCMS_ROOT.$imgurl)) return 'images/nopic.gif';
	$newimgurl = dirname($imgurl).'/thumb_'.$width.'_'.$height.'_'.basename($imgurl);
	if(file_exists(PHPCMS_ROOT.$newimgurl)) return $newimgurl;
	if(!is_object($image))
	{
		require_once 'image.class.php';
		$image = new image();
	}
	return $image->thumb(PHPCMS_ROOT.$imgurl, PHPCMS_ROOT.$newimgurl, $width, $height, '', $autocut) ? $newimgurl : $imgurl;
}

global.func.php下载

本文来自: 关于phpcms首页缩略图显示不了的bug