Tag: MacPorts/php5
$ sudo port install php56-apache2handler php56-mysql php56-mbstring
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.
cd /opt/local/lib/apache2/modules sudo /opt/local/bin/apxs -a -e -n php5 mod_php56.so
To use mysqlnd with a local MySQL server, edit /opt/local/etc/php56/php.ini and set mysql.default_socket, mysqli.default_socket and pdo_mysql.default_socket to the path to your MySQL server's socket file. For mysql5, use /opt/local/var/run/mysql5/mysqld.sock For mysql51, use /opt/local/var/run/mysql51/mysqld.sock For mysql55, use /opt/local/var/run/mysql55/mysqld.sock For mysql56, use /opt/local/var/run/mysql56/mysqld.sock For mariadb, use /opt/local/var/run/mariadb/mysqld.sock For percona, use /opt/local/var/run/percona/mysqld.sock
cd /opt/local/lib/apache2/modules sudo /opt/local/bin/apxs -a -e -n php5 mod_php56.so
$ cd /opt/local/etc/apache2 $ vi httpd.conf
<IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
$ cd /opt/local/etc/php56 $ sudo cp php.ini-development php.ini $ sudo vi php.ini
[mbstring] mbstring.language = Japanese mbstring.internal_encoding = UTF-8 mbstring.http_input = auto mbstring.http_output = UTF-8 mbstring.encoding_translation = On mbstring.detect_order = auto mbstring.substitute_character = none; mbstring.func_overload = 1
$ sudo /opt/local/sbin/apachectl restart
/opt/local/var/run/mysql5/mysqld.sock
/opt/local/var/run/mysql55/mysqld.sock
$ sudo pear channel-discover pear.phpunit.de $ sudo pear channel-discover pear.symfony-project.com $ sudo pear channel-discover pear.symfony.com
$ sudo pear install --alldeps phpunit/PHPUnit
sudo port install php5-xdebug
sudo pear install phpunit
$ sudo port clean php5 $ sudo port install php5 +apache2 +pear
cd /opt/local/apache2/htdocs/ vi info.php
<?php phpinfo(); ?>
sudo port install php5-xdebug
ブラウザのデフォルトエンコーディングとあってない場合UTF-8でそのまま出力すると文字化けするかも。ブラウザによってはでるかもしれないけど、基本的にはcharsetを指定しないとだめ。
<?php header("Content-Type: text/html; charset=UTF-8"); ?>
sudo port install php53-openssl php53-curl
extension=php_curl.dll extension=php_openssl.dll
$ sudo port install php53 +apache2 +pear $ sudo port select php php53