Php

4 posts.

vendor 目录究竟应不应该进 VCS

• Dev Notes

很多项目现在都有组件式的包管理,比如 composer 管理的第三方组件都存放在 vendor 目录下,那么究竟这个目录应不应该放到 git 之类的版本管理里去,之前我的做法是不放,但是后来发现了一个问题,当多台机器面临更新第三方组件的时候,会出现版本不一致的问题,而且本身 Laravel 的 config/app.php 中启用了第三方组件,但是 vendor 目录中还需要 composer update 更新的时候就会报错;

Read more… ( Approximately 244 words, 1 min read )

设置Sublime Text 3下的PHP开发环境

• Dev Notes, Tips

需要做一些PHP的开发工作,工欲善其事,必先利其器.

brew tap homebrew/homebrew-php
brew install curl
brew install php56 --with-homebrew-curl
brew install phpmd php-code-sniffer  php-cs-fixer

在Sublime Text 3里cmd+shift+p中install package,安装如下插件

Read more… ( Approximately 155 words, 1 min read )

在debian使用npm安装出错

• Dev Notes

在一台Debian机器上部署Laravel,nmp install的时候总出错,错误如下

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

nodejs一定是通过apt-get安装过了,查过之后就是还有一些老旧的package在使用node,所以需要安装一下apt-get install nodejs-legacy,之后就OK了

Read more… ( Approximately 158 words, 1 min read )

一个PHP文件的透过HTTP分发的错误

• Dev Notes

同事写一个服务安装脚步,有一个PHP的配置文件要在安装时分发,脚步里是用wget来获取这个文件的,不幸的是Apache加载了mod_php,所以分发的文件是那个PHP文件被modphp解析过的结果,而这种情况下那个PHP文件的执行大多会导致500错误,被分发的文件要么是空要么是Apache的500错误内容或php display error的内容。

Read more… ( Approximately 400 words, 1 min read )