LoginSignup
1
1

More than 5 years have passed since last update.

osxでphpでpostgresを使う 急いでる時

Last updated at Posted at 2016-02-10

Xcodeをインストール

App Storeから。
Xcodeを一回は起動しておく。

コマンドラインツールをインストール

https://developer.apple.com/downloads/

Mac Ports をインストール

https://www.macports.org/install.php

phpをインストール

sudo port install php56

途中で以下のメッセージが出る

To customize php56, copy /opt/local/etc/php56/php.ini-development (if this is a development server) or
/opt/local/etc/php56/php.ini-production (if this is a production server) to /opt/local/etc/php56/php.ini and then make changes.

他のを入れる

sudo port install php56-postgresql
sudo port install php56-mbstring
sudo port install php56-gd
sudo port install php56-mcrypt

php.ini 編集

sudo cp  /opt/local/etc/php56/php.ini-development  /opt/local/etc/php56/php.ini
sudo vim /opt/local/etc/php56/php.ini
php.ini
date.timezone = Asia/Tokyo

サーバー起動

/opt/local/bin/php56 -S localhost:8765
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1