douzhang5984
douzhang5984
2016-01-08 16:37

XAMPP Apache无法在端口81上启动,无法加载动态库?

  • XAMPP 5.6.3-0
  • Mac Yosemite 10.10.5

I ran sudo lsof -nP -iTCP:81 and found that Dropbox was blocking it first, so I unlinked that (never use it). Now, when I run that command, it is empty.

If I run sudo lsof -nP -iTCP:80 I get:

httpd       75    root    4u  IPv6 0xaac1841fb411203d      0t0  TCP *:80 (LISTEN)
httpd      532    _www    4u  IPv6 0xaac1841fb411203d      0t0  TCP *:80 (LISTEN)

Which I think is okay, since it's on a different port, right?

If I look inside the /Applications/XAMPP/logs for the error_log, ssl_request_log, and access_log there isn't anything logged since two months ago.

If I look inside the php_error_log I see this:

[08-Jan-2016 16:13:43 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/php_pdo_mysql.dll' - dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/php_pdo_mysql.dll, 9): image not found in Unknown on line 0

I found a similar problem in this question. I ran the command in the top answer (but obviously changed the dir path to mine), and it didn't work. I read the forum with the link he attached and someone said that on Mac is is DYLD_LIBRARY_PATH not LD_LIBRARY_PATH, so i tried that as well, and it still doesn't work. I've tried restarting my computer and the osx-manager multiple times.

If I look inside the /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/ directory, it doesn't have php_pdo_mysql.dll in there. Is it supposed to be in there already, or is it trying to load the library in there, and it's not working?

I get the dynamic library error every time I try to start it, so I'm guessing that is the issue, but I'm not sure how to fix it.

For clarity, I have these lines in my httpd.conf file:

Listen 81
ServerName localhost:81

And in my php.ini file I have the extension=php_pdo_mysql.dll line uncommented, and it's the only extension uncommented. Does it depend on another extension? I'm so lost.

Update

$ . /Applications/XAMPP/xamppfiles/xampp stopapache
$ XAMPP: Stopping Apache...not running

$ . /Applications/XAMPP/xamppfiles/xampp startapache
$ XAMPP: Starting Apache...fail.
$ XAMPP:  Another web server is already running.

But running lsof -nP -i :81 still gives me no results! =(

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • doulan4939 doulan4939 5年前

    Well, I had to shut down the Apache server running on port 80 for this to work. I thought I wouldn't have to, since I had it configured to run on port 81. My only guess to why this happened is that I had it configured on port 80, started it, and then changed the configuration to 81 before shutting it down. I also had to comment out the php_pdo_mysql extension. I couldn't figure out that issue.

    点赞 评论 复制链接分享

为你推荐