Mac OS上PHP环境配置

本文详细介绍了在Mac OS上配置PHP开发环境的步骤,包括文件路径、参考文章和常用命令。涉及到php.ini、httpd.conf等配置文件的修改,以及如何解决phpize报错问题,确保Oracle Instant Client和oci8扩展的安装与更新。

一、常用文件路径
新版php.ini /usr/local/php5/lib/php.ini
旧版php.ini /etc/php.ini
httpd.conf /etc/apache2/httpd.conf
httpd-vhosts.conf /etc/apache2/extra/httpd-vhosts.conf
php7_module配置文件 /etc/apache2/other/+php-osx.conf -> /usr/local/php5-7.0.27-20180201-135220/entropy-php.conf

二、参考文章
0.max os自带Apache PHP配置
http://blog.csdn.net/iosbird/article/details/62416585

1.MacBook OS X安装Oracle12.1 Instant Client
http://blog.itpub.net/15156791/viewspace-2125870/
SQLPLUS 测试 :sqlplus ds/Oraclebice502@ORCL
之后另外安装SQL developer
http://blog.csdn.net/u012797045/article/details/16984025

2.Installing PHP and the Oracle Instant Client for Linux and Windows
http://www.oracle.com/technetwork/articles/technote-php-instant-084410.html

注意ln -s libclntsh.so.11.1 libclntsh.so

oci8源码下载http://pecl.php.net/package/oci8

oci8编译成功但没有权限写入文件夹时,尝试获取更高权限,或将oci8放在一般权限的文件夹下

安装pecl: https://blog.csdn.net/json_vip/article/details/79324524

3.更新PHP
http://blog.csdn.net/u014451657/article/details/70160345

4.mac下phpize报错Cannot find autoconf. Please check your autoconf installation解决方法
http://blog.csdn.net/happyrabbit456/article/details/44680237

5. mac下phpize报错$ phpize grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/include/php/Zend/zend_modules.h: No such file or directory grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory Configuring for: PHP Api Version: Zend Module Api No: Zend Extension Api No:

执行 $ ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include /usr/include

没有安装xcode的话先安装

其中MacOSX10.12.sdk中的改为相应的系统版本,例如MacOSX10.14.sdk

若没有权限,则重启command+r 打开终端执行csrutile disable

若提示/usr/include存在,则删除/usr/include后再次执行

参考:https://www.cnblogs.com/imayanlong/p/6071805.html

三、常用命令
cd ~
touch info.php
open info.php
sudo vi info.php
vi命令:q q! wq esc<->i
sudo chmod -R 777 /Users/berry/yzd
sudo apachectl restart/start/stop

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值