2

所以我最近升级到 macOS Sierra(Beta),它破坏了我的 PHP/MySQL 配置......这并不奇怪,但是......奇怪的是,一些快速终端命令告诉我 PHP 和 MySQL 都已启动并正在运行!例如... PHP:

myusername@myworkstation  /private/etc/apache2/other  php -v
PHP 5.6.24 (cli) (built: Aug  9 2016 16:05:05)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

所以,我决定跑步

apachectl configtest

这就是问题所在:

httpd: Syntax error on line 537 of /private/etc/apache2/httpd.conf: Syntax error on line 8 of /private/etc/apache2/other/+entropy-php.conf: Cannot load /usr/local/php5/libphp5.so into server: dlopen(/usr/local/php5/libphp5.so, 10): Symbol not found: _environ\n  Referenced from: /usr/local/php5/libphp5.so\n  Expected in: /usr/sbin/httpd\n

所以问题是操作系统找不到或无法加载 PHP ......任何想法如何解决这个问题?似乎是一条不正确的路径,但想知道操作系统方面是否有任何变化导致了这种情况?与此问题有关的 OS Sierra 带宽并不多。希望与最近遇到此问题的其他开发人员或可能更好地了解如何重新启动和运行的人联系。

在此先感谢您的帮助,与此同时,我将继续尝试修复,希望可以迅速解决此问题。

4

4 回答 4

4

今天,当我意识到 macOS Sierra 更新搞砸了我的本地主机时,我注意到了这一点。

在进行了一些挖掘之后,似乎配置文件被覆盖了。我发现开发人员很好地将您以前的配置文件保存在备份文件中,然后再覆盖 /etc/apache2/ 中的默认配置。

对于更新前的原始 httpd.conf,查找名为“httpd.conf~pre-update”的文件

Inside /etc/apache2/extra/, for all your original files, look for the files with the "~previous" at the end of the name.

The .bak files are now backups of the new macOS Sierra apache configs (so I think if you had backups with the .bak, those were overwritten as well, but not 100% sure).

At this point, I'm not sure of the ramifications of setting your original files back as the defaults, but when I restored my original config files, everything magically worked again. Hope this helps anybody else with this issue.

于 2016-09-22T05:17:17.970 回答
3

我有一个类似的问题。似乎 sierra 覆盖了配置文件。我通过取消注释 httpd.conf 中的 php loadmodule 行来使 php 正常工作。我的网站又可以工作了,但我所有的虚拟主机东西似乎都不见了。如果有帮助,我将重新创建配置并添加到其中。

于 2016-09-21T06:04:39.087 回答
0

I had this issue for days. I got php working again by uncommenting the LoadModule php5_module libexec/apache2/libphp5.so line in httpd.conf. I hope this helps.

于 2016-10-15T22:40:03.200 回答
-1

There are lots of config files that have been replaced - so you need to go through them all and reset your entire configuration. The good guys at Apple have really helped out by ensuring every single configuration option is saved at least somewhere on your drive!

Next, you will find your MySQL isn't working, it's changed versions and the databases are no longer where you left them. But don't panic a simple boot into the recovery option, copy the databases from the previous location (if you can find them) to the new location (if you have any idea where that is) is all that is required. But then you may also need to locate the my.cnf - it's gone! I couldn't find the old one, and the new one doesn't tell me where the old one has gone.

But don't go changing the location of the databases - it needs to be in that 'data' folder. Any attempt to move it will result it ghostly apparitions of your data appearing on screens all over the office.

Finally we are back to php and the extensions. Yes - there are a couple missing, mine were mcrypt and memcache, but don't panic, you can find copies in hidden in a folder called 'extensions', but finding that folder will involve you solving a number of strategy games along the way - good luck.

BTW - if you are reading this before you found the 'extensions' folder, it doesn't really matter because those extensions don't work with the installed version of php, so it didn't really matter if you couldn't find them. Just download the source, compile, make, make install, do that twice, maybe three times for good measure, and it still won't work.

I hope this has really helped somebody - I'm sure glad to have it all worked out now.

And don't you think somebody should take responsibility for this?

If only I had stayed on El Capitan!

于 2016-11-02T05:48:25.493 回答