PHP 环境配置

  1. 在使用backdrop时,连接mysql失败,报错

    1
    Failed to connect to your database server. The server reports the following message: No such file or directory.

    需要找php.ini,在terminal输入

    1
    php --ini
找到/private/etc/目录下的php.ini,更改:
  1. 配置PHPdebug环境:

    • 修改php.ini文件,添加关于xdebug的代码:

      1
      2
      cd /private/etc/
      vi php.ini.default

      添加的代码

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      zend_extension = /usr/lib/php/extensions/ no-debug-non-zts-20131226/xdebug.so
      xdebug.remote_autostart=on
      xdebug.remote_enable=on
      xdebug.remote_enable=1
      xdebug.remote_mode="req"
      xdebug.remote_log="/var/log/xdebug.log"
      xdebug.remote_host=localhost/127.0.0.1
      xdebug.remote_port=9000
      xdebug.remote_handler="dbgp"
      xdebug.idekey="PhpStorm"
  2. apache log路径:

    1
    2
    cd /var/log/apache2/
    // error_log acccesslog

PHP常用开源CMS系统

  1. Blackdrop
  2. Octorber

NodeJS常用开源系统

  1. KeystoneJS

MAMP安装与使用

  • MAMP Free和高级版本差别不大,遇到问题使用free版本,只会显示两个php版本,7.0和7.1,而网站使用的版本较低,无法使用。

  • 解决办法:在MAMP的bin目录下有很多PHP版本,如果没有需要的版本,可以从MAMP官网上添加,如果有但是没有显示,就把不想显示的php文件夹备份再删除掉。

  • MAMP打开后MySQL服务无法启动

    • 解决办法:rm /Applications/MAMP/db/mysql56 目录下的log文件、ib_logfileN