apache mysql php mongodb sur MAC OS X el capitan

APACHE

sudo apachectl start
httpd -v

id
=> get username and change in conf
User XXX
Group XXX

sudo emacs /etc/apache2/httpd.conf

DocumentRoot "/Users/username/Sites/"

AllowOverride All
Options Indexes MultiViews FollowSymLinks
Require all granted

LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule php5_module libexec/apache2/libphp5.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so

sudo apachectl restart

http://localhost

MYSQL

http://dev.mysql.com/downloads/mysql/

sudo /usr/local/mysql/support-files/mysql.server start

/usr/local/mysql/bin/mysql -v

/usr/local/mysql/bin/mysqladmin -u root password 'yournewpasswordhere'

emacs .bash_profile
export PATH="/usr/local/mysql/bin:$PATH"

# 2002 mysql socket error
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

PHP

disactivat SIP : disactivate SIP : http://www.macworld.com/article/2986118/security/how-to-modify-system-integrity-protection-in-el-capitan.html

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

cd /usr/lib/php
sudo php install-pear-nozlib.phar
sudo pear channel-update pear.php.net
sudo pecl channel-update pecl.php.net
sudo pear upgrade-all
sudo pear config-set auto_discover 1

brew install autoconf

brew install icu4c
sudo pecl install intl
The path to the ICU libraries and headers is: /usr/local/opt/icu4c/

sudo cp /etc/php.ini.default /etc/php.ini
sudo chmod u+w /etc/php.ini
sudo emacs /etc/php.ini
date.timezone = "Europe/Paris"
error_reporting = E_ALL
display_errors = On
memory_limit = 1024M
extension=intl.so

attention : pas les .dll, ils ne marchent pas

MONGODB

brew install mongodb
sudo services start mongodb

MONGODB DANS PHP

attention ca cree un nouveau php en plus de l'actuel, avec ses propres fichiers de conf.
php: /usr/local/opt/php56/bin/php
php --ini : /usr/local/etc/php/5.6/php.ini
verifier qu'une extension est installee :
php -i | grep "XXX"

brew install php56-mongo

emacs ~/.bashrc
export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"

sudo emacs /etc/apache2/httpd.conf
#LoadModule php5_module libexec/apache2/libphp5.so
LoadModule php5_module /usr/local/Cellar/php56/5.6.22/libexec/apache2/libphp5.so

sudo apachectl restart

INTL VIA BREW

brew install php56-intl

sudo apachectl restart

TEST

sudo emacs phpinfo.php

http://localhost/phpinfo.php

TEST MONGO
comedy;
$collection = $db->cartoons;
$document = array( "title" => "Calvin and Hobbes", "author" => "Bill Watterson" );
$collection->insert($document);
$document = array( "title" => "XKCD", "online" => true );
$collection->insert($document);
$cursor = $collection->find();
foreach ($cursor as $document)
echo $document["title"] . "\n";
?>

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.