PHP - WindyHana's Solanara

목차

개요

PHP7 - 64bit 설치

root@wl ~/src # wget http://kr1.php.net/get/php-7.1.8.tar.xz/from/this/mirror
root@wl ~/src # gtar xvfJ php-7.1.8.tar.xz
root@wl ~/src # cd php-7.1.8
root@wl ~/src/php-7.1.8 # ./configure \
  --prefix=/usr/local/php \
  --with-mysqli=mysqlnd \
  --with-pdo-mysql=mysqlnd \
  --with-pdo-sqlite=/usr/local \
  --with-iconv=/usr/local \
  --with-gd \
  --with-jpeg-dir=/usr/local \
  --with-png-dir=/usr/local \
  --with-zlib-dir=/usr/local \
  --with-freetype-dir=/usr/local \
  --with-openssl=/usr/local/ssl \
  --with-openssl-dir=/usr/local/ssl \
  --with-sqlite3=/usr/local \
  --with-xsl \
  --enable-fpm \
  --enable-calendar \
  --with-curl=/usr/local \
  --enable-mbstring \
  --enable-mbregex \
  --enable-mysqlnd \
  --enable-sigchild \
  --enable-pcntl \
  --enable-gd-native-ttf \
  --enable-wddx \
  --enable-sysvmsg \
  --enable-sysvsem \
  --enable-sysvshm \
  --enable-sockets \
  --enable-soap \
  --enable-ftp \
  --enable-exif \
  --enable-bcmath \
  --enable-zip \
  --enable-opcache \
  --enable-dtrace \
  CFLAGS="-m64" LDFLAGS="-m64" CXXFLAGS="-m64"
root@wl ~/src/php-7.1.8 # vi ext/sockets/conversions.c
// 첫번째 줄에
#if defined (__sun) || defined (__sun__)
#define _XPG4_2
// #define __EXTENSIONS__
#endif
root@wl ~/src/php-7.1.8 # vi ext/sockets/php_sockets.h
#if defined (__sun) || defined (__sun__)

# ifndef CMSG_ALIGN
      /* aligning to sizeof (long) is assumed to be portable (fd.o#40235) */
#     define CMSG_ALIGN(len) (((len) + sizeof (long) - 1) & \
                              ~(sizeof (long) - 1))
# endif

# ifndef CMSG_SPACE
#   define CMSG_SPACE(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + \
                            CMSG_ALIGN (len))
# endif

# ifndef CMSG_LEN
#   define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
# endif

#endif /* Solaris */
root@wl ~/src/php-7.1.8 # make
root@wl ~/src/php-7.1.8 # make install

PHP FastCGI Process Manager

Xdebug

PHP 가속기

DTrace

PHP Build-in Server

PHP 5.4 부터 PHP 자체에 Build-in 개발 서버를 지원한다.

php -S 주소:포트 [-t 문서루트]

문서 루트를 지정하지 않으면, 현재 디렉토리가 문서의 루트가 된다. 따라서 루트 디렉토리에서 PHP Build-in 서버를 옵션 없이 실행해서는 안된다.

root@wl ~ # mkdir phpServer
root@wl ~ # cd phpServer
root@wl ~/phpServer # vi index.php
<?php
	phpinfo.php
?>
root@wl ~/phpServer # /usr/local/php/bin/php -S 211.204.126.106:8009
PHP 5.6.0 Development Server started at Mon Sep 15 20:08:35 2014
Listening on http://211.204.126.106:8009
Document root is /export/home/windy/s
Press Ctrl-C to quit.
[Mon Sep 15 00:00:00 2014] 1.221.41.190:61865 [200]: /

성능은 그저 그런 수준이지만, 개발자를 위한 디버깅용으로는 손색이 없다고 생각한다.

PECL

RSS ATOM XHTML 1.0 CSS3