设为首页 收藏本站
查看: 455|回复: 0

[经验分享] Cygwin PHP + Apache on Windows install tips

[复制链接]

尚未签到

发表于 2015-8-3 07:23:37 | 显示全部楼层 |阅读模式

Index Nav:
[Date Index] [Subject Index] [Author Index] [Thread Index]


Message Nav:
[Date Prev] [Date Next]
[Thread Prev] [Thread Next]


Other format:
[Raw text]

Cygwin PHP + Apache on Windows install tips


  • From: "Karl Brown"
  • To: cygwin at cygwin dot com
  • Date: Wed, 14 Jan 2004 14:05:21 -0600
  • Subject: Cygwin PHP + Apache on Windows install tips


So, you're having trouble installing PHP and Apache under Cygwin on windows??
I've just suffered through some pain in setting this up - the following thread was  
useful to me:
http://www.cygwin.com/ml/cygwin/2003-09/msg01028.html
More importantly, I actually figured out how to make it work.  Here are the changes  
you have to make if you really want to go this route.  Looking back, I think I would  
have been better off installing a vanilla windows version of apache, and the vanilla  
windows distribution of PHP - that is what most people do and it seems to work  
better.  But if you want to go the hardcore route, see below.
1) This was done with Apache 1.3.24-5 and PHP 4.2.0-2.
2) I will assume that apache is already installed and working - even doing that is  
non-trivial, but this page is helpful:  
http://apache.dev.wapme.net/manual/cygwin.html.  Just remember that apache  
cygwin does not accept windows directory names (i.e. d:/foo/bar) - you have to use
/cygdrive/d/foo/bar
3) There are bugs in the PHP installer, so we have to work around them.  Luckily, it  
is not that difficult.
so, the steps:
0) Stop your apache server
1) Install the PHP package using the cygwin installer.  This will copy the  
documentation, but you'll notice that the libphp4.dll is somehow missing!  This is the  
first bug.
2) To correct this bug, you'll have to edit the apache-php.sh script which is stored in  
/etc/postinstall - it should be named 'apache-php.sh.done' at this point.
3) Open it up, save a backup copy, and replace it with the following:
===
#!/bin/sh
module=php4
module_dll=libphp4.dll
prefix=/usr
confdir=/etc
libdir=${prefix}/lib/apache
echo ${libdir}
rebase_dlls="${libdir}/${module_dll}  
${prefix}/bin/cygbz21.0.dll ${prefix}/bin/cygcrypto.dll  
${prefix}/bin/cygintl-1.dll ${prefix}/bin/pq.dll  
${prefix}/bin/cygxml2-2.dll ${prefix}/bin/cygz.dll  
${prefix}/bin/cyggdbm.dll ${prefix}/bin/cygssl-0.9.7.dll   
D:\apps\cygwin\bin\cygiconv-2.dll"
echo ${rebase_dlls}
cd ${libdir}/new
${prefix}/sbin/apxs -i -a -n ${module} ${module_dll}
echo ${module} ${module_dll}
${prefix}/bin/rebase -d -b 0x68000000 -o 0x10000  
${rebase_dlls}
#${prefix}/bin/rebase ${rebase_dlls}
#don't remove module dll
#rm -f ${libdir}/new/${module_dll}
===
The changes I made were:
1) add ${prefix}/bin/cygssl-0.9.7.dll  D:\apps\cygwin\bin\cygiconv-2.dll to the dlls to  
be re-based.  This I figured out through trial and error
2) uncommented the rebase command that had been commented out, and  
commented out the rebase command with bad syntax (no -d -b 0x etc.)
3) commented the line that removes the libphp4.dll

Also, rename the file to apache-php-sh
4) unzip and untar the php distribution - it should be wherever you set Cygwin to  
download packages.
> cd {wherever this file is located}
> bunzip2 apache-php-4.3.0-2.tar.bz2
> tar -xvf apache-php-4.2.0-2.tar
Within this tarball, you should be able to find libphp4.dll - drop that in /lib/apache
5) Now, run the post install script:
$ sh apache-php.sh
This should now rebase all of the necessary dlls and install the libphp4.dll as a  
shared object.
6) Now open up your httpd.conf file and add the following lines:
LoadModule php4_module lib/apache/libphp4.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php
7) now take a sample .php page and start up your apache server - it should be  
working now.  if you want to set up your php as a CGI handler, there are other  
resources on the web for that.
I hope this helps someone else out there, and hopefully whoever is in charge can fix  
these (relatively) simple problem in the installer script.
thanks,
karl brown
karl at cs.stanford.edu_nospam
(remove nospam to send)

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



Index Nav:
[Date Index] [Subject Index] [Author Index] [Thread Index]


Message Nav:
[Date Prev] [Date Next]
[Thread Prev] [Thread Next]

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-93427-1-1.html 上篇帖子: apache的优化配置【全局配置文件】 下篇帖子: apache+mod_wsgi配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表