关键词:
Install git:
sudo apt-get install git
Configure Git:
touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"
git config --global user.email "Your Email"
ssh-keygen -t rsa -C "Your Email"
cat ~/.ssh/id_rsa.pub
(Optional) Use PHP 5.4.x:
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
(Optional) Use PHP 5.5.x:
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
(Optional) Use PHP 5.6.x:
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
Install apache/php:
sudo apt-get install apache2 php5 php5-cli libapache2-mod-php5 php5-dev
Ensure this worked by visiting ``http://localhost/``. You should see **It works!**.
Edit your php.ini:
sudo nano /etc/php5/cli/php.ini
1. Add a timezone
date.timezone = America/New_York
2. Turn off short tags
short_open_tag = Off
3. Increase `xdebug.max_nesting_level`
xdebug.max_nesting_level = 250
Install mysql (enter through password prompts to use use defaults):
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
Install phpmyadmin (choose apache2 and enter through password prompts to use default):
sudo apt-get install phpmyadmin
Edit phpmyadmin ``config.inc.php``:
sudo nano /etc/phpmyadmin/config.inc.php
Add/edit the following (around page 42):
```php
// ...
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
$cfg['Servers'][$i]['user'] = 'root';
/* Server parameters */
// ...
```
Ensure this worked by visiting ``http://localhost/phpmyadmin``.
Install useful php modules:
sudo apt-get install php5-mcrypt php5-xdebug php5-curl php5-sqlite php5-xsl php-pear php-apc
Change php.ini directory for apache to use the same config as cli:
Edit ``/etc/apache2/mods-enabled/php5.load`` to look like the following:
PHPIniDir "/etc/php5/cli"
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
Install PHPUnit:
sudo pear config-set auto_discover 1
sudo pear install pear.phpunit.de/PHPUnit
Install Composer:
sudo apt-get install curl
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
Install node.js/npm:
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
Install some npm modules:
sudo npm install -g bower
sudo npm install -g uglify-js
sudo npm install -g uglifycss
sudo npm install -g grunt-cli
sudo npm install -g zombie
# Appendix
## A. Configure Apache Sites
Enable Apache mods:
sudo a2enmod rewrite vhost_alias
Add Apache site:
sudo nano /etc/apache2/sites-available/dev
Add the following:
```
<VirtualHost *:80>
ServerName localhost
DocumentRoot /home/user/www
</VirtualHost>
<VirtualHost *:80>
ServerAlias *.local
VirtualDocumentRoot /home/user/www/%1/web
</VirtualHost>
# For SSL
#<VirtualHost *:443>
# ServerAlias *.local
# VirtualDocumentRoot /home/kbond/www/%1/web
#
# SSLEngine on
# SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
# SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
#</VirtualHost>
```
Enable the site:
sudo a2ensite dev
Restart Apache:
sudo apache2ctl restart
Ensure your sites are added to `/etc/hosts`:
127.0.0.1 mysite.local
## B. Enable SSL
Install ``ssl-cert``:
sudo apt-get install ssl-cert
Enable ssl and default ssl site in apache:
sudo a2enmod ssl
sudo a2ensite default-ssl
sudo service apache2 restart
## C. Install Twig C Extension
Reference: http://twig.sensiolabs.org/doc/intro.html#installing-the-c-extension
Ensure `gcc` is intalled:
sudo apt-get install gcc
Then run the following:
git clone https://github.com/fabpot/Twig.git
cd Twig/ext/twig/
sudo phpize
sudo ./configure
sudo make
sudo make install
Add the following to your `php.ini`:
extension=twig.so
Restart Apache:
sudo apache2ctl restart
## D. Enable ACL
Edit your filesystem table:
sudo nano /etc/fstab
Add `acl` to the options column of `ext4`:
```
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=... / ext4 acl,errors=remount-ro 0 1
```
## E. Install icu/php-intl from source
[Download latest ICU](http://site.icu-project.org/download)
```
./configure
make
make install
```
[Download latest intl](http://pecl.php.net/package/intl)
```
phpize
./configure
make
make install
```
Add the following to your `php.ini`:
extension=intl.so
## F. Install pdo_dblib/mssql from source
**UPDATE:** on Ubuntu 14.04 and PHP 5.6 you can simply install Sybase DB:
apt-get install php5-sybase
---
[Download latest FreeTDS](http://www.freetds.org/) and compile:
```
./configure --prefix=/usr/local/freetds --with-tdsver=7.0 --enable-msdblib --with-gnu-ld
make
make install
```
[Download source for your version of php](https://github.com/php/php-src)
Compile `pdo_dblib`:
```
cd ext/pdo_dblib
phpize
./configure --with-pdo-dblib=/usr/local/freetds --with-php-config=/path/to/php-config
make
make install
```
Compile `mssql`:
```
cd ext/mssql
phpize
./configure --with-mssql=/usr/local/freetds --with-php-config=/path/to/php-config
make
make install
```
Add the following to your `php.ini`:
```
extension=pdo_dblib.so
extension=mssql.so
```
**Note**: ensure these are below `extension=pdo.so`
Ensure `dblib` it is available with:
php -r "phpinfo();" | grep "PDO drivers"
**Note**: during `./configure` if you get the error: `configure: error: Cannot find php_pdo_driver.h.`, edit the following section in the `./configure` file:
From:
```bash
if test -f $abs_srcdir/include/php5/ext/pdo/php_pdo_driver.h; then
pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
pdo_cv_inc_path=$prefix/include/php/ext
fi
```
To:
```bash
pdo_cv_inc_path=/path/to/php_pdo_driver.h # mine was: /usr/include/php5/ext/pdo/php_pdo_driver.h
```
## G. Install [weasyprint](http://weasyprint.org/)
Install dependencies:
sudo apt-get install python-dev python-pip python-lxml libcairo2 libpango1.0-0 libgdk-pixbuf2.0-0 libffi-dev libxml2-dev libxslt-dev
Install weasyprint:
sudo pip install weasyprint
## H. Install [wkhtmltopdf](http://wkhtmltopdf.org/) dependencies
sudo apt-get install libxrender1 libfontconfig1 libxtst6
2-3flutter开发环境与ios开发环境设置(mac)
Mac下环境搭建先不看了都是Mac下的环境搭建 查看详情
flutter开发环境与android开发环境设置(代码片段)
...)3.获取FlutterSDK3.1下载安装包3.2配置环境变量3.3Android开发环境设置3.3.1创建androi 查看详情
如何设置 TrustZone 开发环境
】如何设置TrustZone开发环境【英文标题】:HowtosetupaTrustZonedevelopmentenvironment【发布时间】:2018-06-1923:03:16【问题描述】:我想开始玩ARMTrustZone,所以我想设置一个开发环境,不幸的是我觉得我仍然缺少一些东西,我不知道如何将... 查看详情
shmac开发环境设置(代码片段)
查看详情
markdownmacosxrails开发环境设置(代码片段)
查看详情
blog开发环境环境设置
所需要环境: win10 python2.7.10 django1.10.6 mysql mysql-python pillow ├─.idea├─blog│└─migrations├─Blog_project├─static└─templatessetting设置LANGUAGE_CODE=‘zh-hans‘#语言TIME_ZONE=‘A 查看详情
设置 MobileFirst 开发环境
】设置MobileFirst开发环境【英文标题】:SettingUpMobileFirstDevEnvironment【发布时间】:2016-09-1321:19:05【问题描述】:操作系统:Windows7面向Web开发人员的EclipseJavaEEIDE。版本:Mars.2版本(4.5.2)内部版本号:20160226-0632JavaJRE7Javajdk1.7.0_79Mobil... 查看详情
安装程序如何设置复杂的开发人员环境?
】安装程序如何设置复杂的开发人员环境?【英文标题】:howaboutaninstallertosetupcomplicateddeveloperenvironment?【发布时间】:2012-04-0405:04:16【问题描述】:我们的开发人员环境设置往往有很多活动部件和很多步骤。每天当我们需要进... 查看详情
bigbluebutton-设置自己的开发环境
设置开发环境欢迎来到BigBlueButton1.1的BigBlueButton开发人员指南。在设置开发环境之前,您需要安装一个工作的BigBlueButton1.1服务器(请参阅安装步骤)。概观BigBlueButton服务器是从与Ubuntu软件包相对应的许多组件构建的。这些组件... 查看详情
用于包/组件开发的 Delphi 环境设置
】用于包/组件开发的Delphi环境设置【英文标题】:DelphiEnvironmentSetupforPackage/ComponentDevelopment【发布时间】:2011-03-2303:31:27【问题描述】:在阅读了一些邮件列表和bbs之后,我找不到合适的方法来设置我的开发环境以进行包和组件... 查看详情
如何设置多开发者 Biztalk 环境?
】如何设置多开发者Biztalk环境?【英文标题】:Howtosetupamulti-developerBiztalkenvironment?【发布时间】:2010-10-2422:55:54【问题描述】:如果我们有3名开发人员在同一个Biztalk项目上工作,那么设置我们的开发环境的最佳方式是什么?我... 查看详情
springboot中如何设置不同的开发环境
通过不同的application-*.yml设置不同的开发环境当我们需要哪个配置环境时,只需要在application.properties中指定即可,如下图所示: 如下测试:@RestControllerpublicclassIndexController{@RequestMapping("/index")publicStringindex(){return"helloworld";} 查看详情
markdown打字稿开发环境设置(代码片段)
查看详情
markdown设置php开发环境(代码片段)
查看详情
如何为 UCMA 4.0 开发设置环境
】如何为UCMA4.0开发设置环境【英文标题】:HowtosetupanenvironmentforUCMA4.0development【发布时间】:2013-12-1916:50:38【问题描述】:我想开始UCMA4.0开发。我想构建一个单一的VM环境,我可以在其中安装UCMASDK的所有依赖项。是否有任何地... 查看详情
如何设置捆绑开发环境(Eclipse Equinox Maven)
】如何设置捆绑开发环境(EclipseEquinoxMaven)【英文标题】:Howtosetupbundledevelopmentenvironment(EclipseEquinoxMaven)【发布时间】:2010-11-2718:17:52【问题描述】:我正在尝试设置Eclipse环境来开发捆绑包(使用maven-bundle-plugin-bnd)并运行和调... 查看详情
vs怎么重置设置开发环境
...接重置为预设状态即可,有几种预设可选,是针对不同的开发者的,如C#、C++和Web开发本回答被提问者采纳 查看详情
markdownmacosxrails开发环境设置-第2部分(代码片段)
查看详情