OSX-找不到我的php.ini [英] OSX - can't find my php.ini

查看:96
本文介绍了OSX-找不到我的php.ini的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将OSX更新为特立独行的,我也可以使用apache和phpmyadmin.

I recently updated my OSX to mavericks, i kind of got apache and phpmyadmin to work too.

问题是,当我编辑 php.ini.default 时,签入phpinfo();(当然要重新启动Apache)时没有做任何更改

problem is, when i edit the php.ini.default no changes were made when i check in phpinfo(); (restarted Apache of course)

phpinfo()中的版本与下面的相同

the version in phpinfo() is the same as below

$ 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

但是当我检查我的配置文件时,加载的配置文件不显示.

but when i check for my configuration file, the loaded configuration file doesn't show.

$ php -i | grep 'Configuration File'
Configuration File (php.ini) Path => /etc
Loaded Configuration File => (none)

我使用此命令打开我的php.ini.deault

to open my php.ini.deault i used this command

sudo nano /private/etc/php.ini.default

不确定是否有帮助,但这是/private/etc/文件夹中的文件列表

not sure if this might help, but here is a list of files in the /private/etc/ folder

$ 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在哪里?

what am i missing? and where is the php.ini that is being used?

更新:

将php.ini.default重命名为php.ini,并出现此错误.

renamed php.ini.default to php.ini and got this errors.

$ 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

推荐答案

将php.ini.default复制到php.ini,而不是将其移动

copy php.ini.default to php.ini instead of moving it

修改php.ini

重新启动apache,你应该很好

restart apache and you should be good

这篇关于OSX-找不到我的php.ini的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆