为什么我的 mac php+apache 不成功啊

2015-05-08 10:01:43 +08:00
 holinhot

LoadModule php5_module libexec/apache2/libphp5.so
前面的注释我取消了啊
LouisdeMacBook-Pro:local louis$ sudo find -name libphp5.so
find: illegal option -- n
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]
LouisdeMacBook-Pro:local louis$ sudo find / -name libphp5.so
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/usr/libexec/apache2/libphp5.so
/usr/local/Cellar/php54/5.4.40/libexec/apache2/libphp5.so
/usr/local/Cellar/php55/5.5.24/libexec/apache2/libphp5.so
/usr/local/Cellar/php56/5.6.8/libexec/apache2/libphp5.so

apache运行正常 但是php跑不起来啊。我别外装的版本在phpstorm运行正常 。自带的apache开启php总不成功

2617 次点击
所在节点    Apple
11 条回复
holinhot
2015-05-08 10:05:12 +08:00
奇怪我都停了怎么还能访问
LouisdeMacBook-Pro:local louis$ sudo apachectl stop
LouisdeMacBook-Pro:local louis$ curl -I 127.0.0.1
HTTP/1.1 200 OK
Date: Fri, 08 May 2015 02:04:35 GMT
Server: Apache/2.4.9 (Unix)
Content-Location: index.html.en
Vary: negotiate
TCN: choice
Last-Modified: Mon, 11 Jun 2007 18:53:14 GMT
ETag: "2d-432a5e4a73a80"
Accept-Ranges: bytes
Content-Length: 45
Content-Type: text/html
66beta
2015-05-08 10:06:31 +08:00
上xampp,保平安
holinhot
2015-05-08 10:07:37 +08:00
我知道了
LouisdeMacBook-Pro:local louis$ sudo apachectl -k start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using LouisdeMacBook-Pro.local. Set the 'ServerName' directive globally to suppress this message
LouisdeMacBook-Pro:local louis$ curl -I 127.0.0.1
HTTP/1.1 200 OK
Date: Fri, 08 May 2015 02:07:01 GMT
Server: Apache/2.4.9 (Unix) PHP/5.5.14
Content-Location: index.html.en
Vary: negotiate
TCN: choice
Last-Modified: Mon, 11 Jun 2007 18:53:14 GMT
ETag: "2d-432a5e4a73a80"
Accept-Ranges: bytes
Content-Length: 45
Content-Type: text/html
holinhot
2015-05-08 10:08:00 +08:00
@66beta 不喜欢
Septembers
2015-05-08 10:35:13 +08:00
vagrant 拯救你
ysz1121
2015-05-08 14:06:04 +08:00
建议使用 vagrant + vbox进行开发
railgun
2015-05-08 14:12:31 +08:00
mac 本身就已经开启了Apache服务,设置比较奇葩,反正我没弄成功过
banri
2015-05-08 14:23:39 +08:00
直接装MAMP即可
或者楼上说的XAMMP
banri
2015-05-08 14:24:37 +08:00
@banri XAMPP(手滑~
holinhot
2015-05-08 17:10:29 +08:00
@banri 是手抖
Emi
2015-05-08 23:11:45 +08:00
mamp 我在用。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/189387

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX