我最近将我的OSX更新为mavericks,我也得到了apache和phpmyadmin。
问题是,当我编辑 php.ini.default 时,当我签入phpinfo();
时没有进行任何更改(当然重启Apache)
phpinfo()
中的版本与下面的版本相同
$ php -v
PHP 5.4.17 (cli) (built: Aug 25 2013 02:03:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
但是当我检查配置文件时,加载的配置文件没有显示。
$ php -i | grep 'Configuration File'
Configuration File (php.ini) Path => /etc
Loaded Configuration File => (none)
打开我的php.ini.deault我使用了这个命令
sudo nano /private/etc/php.ini.default
不确定这是否有帮助,但这里是 / private / etc / 文件夹中的文件列表
$ ls
AFP.conf nanorc
afpovertcp.cfg networks
aliases newsyslog.conf
aliases.db newsyslog.d
apache2 nfs.conf
asl notify.conf
asl.conf ntp-restrict.conf
authorization.deprecated ntp.conf
auto_home ntp_opendirectory.conf
auto_master openldap
autofs.conf pam.d
bashrc passwd
com.apple.screensharing.agent.launchd paths
csh.cshrc paths.d
csh.login periodic
csh.logout pf.anchors
cups pf.conf
defaults pf.os
dnsextd.conf php-fpm.conf.default
efax.rc php.ini-5.2-previous
emond.d php.ini.default
find.codes php.ini.default-5.2-previous
fstab.hd postfix
ftpd.conf ppp
ftpd.conf.default profile
ftpusers protocols
gettytab racoon
group rc.common
hostconfig rc.imaging
hostconfig~orig rc.netboot
hosts resolv.conf
hosts.equiv rmtab
hosts~orig rpc
ip6addrctl.conf rtadvd.conf
irbrc security
kern_loader.conf services
krb5.keytab shells
localtime snmp
locate.rc ssh_config
mach_init.d ssh_config~orig
mach_init_per_login_session.d sshd_config
mach_init_per_user.d sshd_config~previous
mail.rc sudoers
man.conf syslog.conf
manpaths ttys
manpaths.d xtab
master.passwd zshenv
moduli
我错过了什么?正在使用的php.ini在哪里?
更新
将php.ini.default重命名为php.ini并出现此错误。
$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/php_pdo_mysql.dll' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/php_pdo_mysql.dll, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/php_pdo_mysql.dll' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/php_pdo_mysql.dll, 9): image not found in Unknown on line 0
PHP 5.4.17 (cli) (built: Aug 25 2013 02:03:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
答案 0 :(得分:8)
将php.ini.default复制到php.ini而不是移动它
修改php.ini
重启apache你应该很好
答案 1 :(得分:0)