아림이의 라이프~~~~!!!

리눅스 서버 본문

서버

리눅스 서버

아이린84 2017. 12. 1. 20:50

Zend Optimizer사용하기



설치환경은 다음과 같다.

Glibc 2.1
apache 2.0
php 4.0.6
zend optimizer 1.1.0

zend.com에 접속하여 Zend Optimizer를 얻어온다.
Zend Optimizer는 무료로 배포된다. 단지 zend.com에 등록후 다운받을 수 있다.
Zend Optimizer는 PHP의 버전에 따라 호환되는 버전이 존재하므로 자신이 사용하는 환경에 맞는 것을 선택한다.
Zend Optimizer는 현재 솔라리스, 리눅스, FreeBSD, 윈도계열만 지원한다.

[root@ns kang]# tar xvzf "ZendOptimizer-1[1].1.0-PHP_4.0.5-Linux_glibc21-i386.tar.gz" -C /usr/local/src
[root@ns kang]# cd /usr/local/src
[root@ns src]# cd ZendOptimizer-1.1.0-PHP_4.0.5-Linux_glibc21-i386/
[root@ns ZendOptimizer-1.1.0-PHP_4.0.5-Linux_glibc21-i386]# l
total 199
-rw-r--r--    1 root     root          101 May  1 17:33 BUILD
-rw-r--r--    1 root     root          832 Mar 21 02:45 README
-rwxr-xr-x    1 root     root       194132 May  1 17:33 ZendOptimizer.so*
-rw-r--r--    1 root     root         3594 Nov  8  2000 acceleratedbyoptimizer.gif
drwxr-xr-x    2 root     root         1024 Apr 15 17:41 doc/
-rw-r--r--    1 root     root           51 May  1 17:33 md5

설치방법은 doc디렉토리의 ZendOptimizer_UserGuide.pdf파일에 나와있다.

Zend Optimizer는 일반적인 APM(Apache,PHP,MySQL)설치과정과 동일하나, 단지 PHP Configure시
 --disable-debug옵션을 준다는것만 주의하면 된다.(디폴트로 --enable-debug로 되어 있다)

/php.ini파일(/usr/local/lib/php.ini)에 다음을 추가한다.
zend_optimizer.optimization_level=15
zend_extension="/usr/local/lib/ZendOptimizer.so"

php설치후 전형적인 테스트 코드인 phpinfo()함수로 제대로 실행되는지 파악한다.







PHP Logo

PHP Version 4.4.9


System Linux SU020.suidc.com 2.6.32-573.12.1.el6.x86_64 #1 SMP Tue Dec 15 21:19:08 UTC 2015 x86_64
Build Date Jan 19 2016 16:58:13
Configure Command './configure' '--prefix=/usr/local/php_4.4.9' '--with-libdir=lib64' '--with-mysql=/usr/local/mysql' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-zlib' '--with-gd' '--with-ttf' '--with-png' '--with-expat-dir=/usr' '--with-gmp' '--with-xml' '--with-language=korean' '--with-charset=euc_kr' '--disable-debug' '--disable-rpath' '--with-iconv' '--enable-safe-mode' '--enable-magic-quotes' '--enable-bcmath' '--enable-dio' '--enable-gd-native-ttf' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-pic' '--enable-inline-optimization' '--enable-mbstring' '--enable-mbregex' '--enable-mbstr-enc-trans' '--with-config-file-' '--enable-ftp' '--disable-debug' '--enable-track-vars=yes' '--with-jpeg-dir' '--with-freetype-dir' '--enable-gd-native-ttf' '--enable-dl' '--enable-gd-imgstrttf' '--with-curl' '--with-xml2' '--with-xpm-dir=/usr' '--with-mcrypt' '--enable-exif' '--with-openssl' '--enable-sockets' '--enable-soap'
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/php_4.4.9/lib/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20050606
Debug Build no
Zend Memory Manager enabled
Thread Safety disabled
Registered PHP Streams php, http, ftp, https, ftps, compress.zlib

Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies


PHP Credits


Configuration

PHP Core

DirectiveLocal ValueMaster Value
allow_call_time_pass_referenceOnOn
allow_url_fopenOnOn
always_populate_raw_post_dataOffOff
arg_separator.input&&
arg_separator.output&&
asp_tagsOffOff
auto_append_fileno valueno value
auto_prepend_fileno valueno value
browscapno valueno value
default_charsetno valueno value
default_mimetypetext/htmltext/html
define_syslog_variablesOffOff
disable_classesno valueno value
disable_functionsno valueno value
display_errorsOnOn
display_startup_errorsOffOff
doc_rootno valueno value
docref_extno valueno value
docref_rootno valueno value
enable_dlOnOn
error_append_stringno valueno value
error_logno valueno value
error_prepend_stringno valueno value
error_reporting20392039
expose_phpOnOn
extension_dir././
file_uploadsOnOn
gpc_orderGPCGPC
highlight.bg#FFFFFF#FFFFFF
highlight.comment#FF8000#FF8000
highlight.default#0000BB#0000BB
highlight.html#000000#000000
highlight.keyword#007700#007700
highlight.string#DD0000#DD0000
html_errorsOnOn
ignore_repeated_errorsOffOff
ignore_repeated_sourceOffOff
ignore_user_abortOffOff
implicit_flushOffOff
include_path.:/usr/local/php_4.4.9/lib/php.:/usr/local/php_4.4.9/lib/php
log_errorsOffOff
log_errors_max_len10241024
magic_quotes_gpcOnOn
magic_quotes_runtimeOffOff
magic_quotes_sybaseOffOff
max_execution_time3030
max_input_nesting_level500500
max_input_time6060
open_basedirno valueno value
output_bufferingno valueno value
output_handlerno valueno value
post_max_size60M60M
precision1212
register_argc_argvOnOn
register_globalsOnOn
report_memleaksOnOn
safe_modeOffOff
safe_mode_exec_dirno valueno value
safe_mode_gidOffOff
safe_mode_include_dirno valueno value
sendmail_fromno valueno value
sendmail_path/usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i 
serialize_precision100100
short_open_tagOnOn
SMTPlocalhostlocalhost
smtp_port2525
sql.safe_modeOffOff
track_errorsOffOff
unserialize_callback_funcno valueno value
upload_max_filesize50M50M
upload_tmp_dirno valueno value
user_dirno valueno value
variables_orderEGPCSEGPCS
xmlrpc_error_number00
xmlrpc_errorsOffOff
y2k_complianceOnOn

apache2handler

Apache Version Apache/2.0.65 (Unix) mod_ssl/2.0.65 OpenSSL/1.0.0-fips PHP/4.4.9
Apache API Version 20020903
Server Administrator you@example.com
Hostname:Port www.linux.co.kr:0
User/Group nobody(99)/-1
Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts Connection: 10 - Keep-Alive: 15
Virtual Server Yes
Server Root /usr/local/apache_2.0.65
Loaded Modules core mod_access mod_auth mod_include mod_deflate mod_log_config mod_env mod_headers mod_unique_id mod_setenvif mod_ssl prefork http_core mod_mime mod_status mod_autoindex mod_asis mod_cgi mod_negotiation mod_dir mod_imap mod_actions mod_userdir mod_alias mod_rewrite mod_so sapi_apache2 mod_geoip mod_auth_form mod_security2 mod_url2

DirectiveLocal ValueMaster Value
engine11
last_modified00
xbithack00

Apache Environment

VariableValue
UNIQUE_ID 9tjMWN5hvRQAAEZ3WY4AAAAE
GEOIP_ADDR 210.90.202.19
GEOIP_CONTINENT_CODE AS
GEOIP_COUNTRY_CODE KR
GEOIP_COUNTRY_NAME Korea, Republic of
go_out 1
HTTPS on
HTTP_ACCEPT text/html, application/xhtml+xml, */*
HTTP_REFERER https://www.linux.co.kr/linux/
HTTP_ACCEPT_LANGUAGE ko-KR
HTTP_USER_AGENT Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; SMJB; rv:11.0) like Gecko
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_HOST www.linux.co.kr
HTTP_DNT 1
HTTP_CONNECTION Keep-Alive
HTTP_GEOIP_ADDR 210.90.202.19
HTTP_GEOIP_CONTINENT_CODE AS
HTTP_GEOIP_COUNTRY_CODE KR
HTTP_GEOIP_COUNTRY_NAME Korea, Republic of
PATH /sbin:/usr/sbin:/bin:/usr/bin
SERVER_SIGNATURE <address>Apache/2.0.65 (Unix) mod_ssl/2.0.65 OpenSSL/1.0.0-fips PHP/4.4.9 Server at www.linux.co.kr Port 443</address>
SERVER_SOFTWARE Apache/2.0.65 (Unix) mod_ssl/2.0.65 OpenSSL/1.0.0-fips PHP/4.4.9
SERVER_NAME www.linux.co.kr
SERVER_ADDR 222.97.189.20
SERVER_PORT 443
REMOTE_ADDR 210.90.202.19
DOCUMENT_ROOT /home/su/www
SERVER_ADMIN you@example.com
SCRIPT_FILENAME /home/su/www/linux/dbakorea/page11.htm
REMOTE_PORT 63550
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING no value
REQUEST_URI /linux/dbakorea/page11.htm
SCRIPT_NAME /linux/dbakorea/page11.htm

HTTP Headers Information

HTTP Request Headers
HTTP Request GET /linux/dbakorea/page11.htm HTTP/1.1
Accept text/html, application/xhtml+xml, */*
Referer https://www.linux.co.kr/linux/
Accept-Language ko-KR
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; SMJB; rv:11.0) like Gecko
Accept-Encoding gzip, deflate
Host www.linux.co.kr
DNT 1
Connection Keep-Alive
GEOIP_ADDR 210.90.202.19
GEOIP_CONTINENT_CODE AS
GEOIP_COUNTRY_CODE KR
GEOIP_COUNTRY_NAME Korea, Republic of
HTTP Response Headers
X-Powered-By PHP/4.4.9
Keep-Alive timeout=15, max=98
Connection Keep-Alive
Transfer-Encoding chunked
Content-Type text/html; charset=euc-kr

bcmath

BCMath support enabled

ctype

ctype functions enabled

curl

CURL support enabled
CURL Information libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2

dio

dio support enabled

exif

EXIF Support enabled
EXIF Version 1.4 $Id: exif.c,v 1.118.2.37.2.8 2007/12/31 07:22:46 sebastian Exp $
Supported EXIF Version 0220
Supported filetypes JPEG,TIFF

ftp

FTP support enabled

gd

GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled

gmp

gmp support enabled

iconv

iconv support enabled
iconv implementation glibc
iconv library version 2.12

DirectiveLocal ValueMaster Value
iconv.input_encodingISO-8859-1ISO-8859-1
iconv.internal_encodingISO-8859-1ISO-8859-1
iconv.output_encodingISO-8859-1ISO-8859-1

mbstring

Multibyte Support enabled
Japanese support enabled
Simplified chinese support enabled
Traditional chinese support enabled
Korean support enabled
Russian support enabled
Multibyte (japanese) regex support enabled

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

DirectiveLocal ValueMaster Value
mbstring.detect_orderno valueno value
mbstring.encoding_translationOffOff
mbstring.func_overload00
mbstring.http_inputpasspass
mbstring.http_outputpasspass
mbstring.internal_encodingno valueno value
mbstring.languageneutralneutral
mbstring.substitute_characterno valueno value

mcrypt

mcrypt supportenabled
version >= 2.4.x
Supported ciphers cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream

DirectiveLocal ValueMaster Value
mcrypt.algorithms_dirno valueno value
mcrypt.modes_dirno valueno value

mysql

MySQL Supportenabled
Active Persistent Links 0
Active Links 0
Client API version 4.1.22
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE -I/usr/local/mysql/include/mysql
MYSQL_LIBS -L/usr/local/mysql/lib/mysql -lmysqlclient

DirectiveLocal ValueMaster Value
mysql.allow_persistentOnOn
mysql.connect_timeout6060
mysql.default_hostno valueno value
mysql.default_passwordno valueno value
mysql.default_portno valueno value
mysql.default_socketno valueno value
mysql.default_userno valueno value
mysql.max_linksUnlimitedUnlimited
mysql.max_persistentUnlimitedUnlimited
mysql.trace_modeOffOff

openssl

OpenSSL support enabled
OpenSSL Version OpenSSL 1.0.1e-fips 11 Feb 2013

overload

User-Space Object Overloading Support enabled

pcre

PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 7.7 2008-05-07

posix

Revision $Revision: 1.51.2.4.2.4 $

session

Session Support enabled
Registered save handlers files user

DirectiveLocal ValueMaster Value
session.auto_startOffOff
session.bug_compat_42OnOn
session.bug_compat_warnOnOn
session.cache_expire180180
session.cache_limiternocachenocache
session.cookie_domainno valueno value
session.cookie_lifetime00
session.cookie_path//
session.cookie_secureOffOff
session.entropy_fileno valueno value
session.entropy_length00
session.gc_divisor100100
session.gc_maxlifetime14401440
session.gc_probability11
session.namePHPSESSIDPHPSESSID
session.referer_checkno valueno value
session.save_handlerfilesfiles
session.save_path/tmp/tmp
session.serialize_handlerphpphp
session.use_cookiesOnOn
session.use_only_cookiesOffOff
session.use_trans_sidOffOff

sockets

Sockets Support enabled

standard

Regex Library Bundled library enabled
Dynamic Library Support enabled
Path to sendmail /usr/sbin/sendmail -t -i

DirectiveLocal ValueMaster Value
assert.active11
assert.bail00
assert.callbackno valueno value
assert.quiet_eval00
assert.warning11
auto_detect_line_endings00
default_socket_timeout6060
safe_mode_allowed_env_varsPHP_PHP_
safe_mode_protected_env_varsLD_LIBRARY_PATHLD_LIBRARY_PATH
url_rewriter.tagsa=href,area=href,frame=src,input=src,form=,fieldset=a=href,area=href,frame=src,input=src,form=,fieldset=
user_agentno valueno value

tokenizer

Tokenizer Support enabled

wddx

WDDX Supportenabled
WDDX Session Serializer enabled

xml

XML Support active
XML Namespace Support active
EXPAT Version expat_1.95.7

zlib

ZLib Support enabled
Compiled Version 1.2.3
Linked Version 1.2.3

DirectiveLocal ValueMaster Value
zlib.output_compressionOffOff
zlib.output_compression_level-1-1
zlib.output_handlerno valueno value

Additional Modules

Module Name
sysvsem
sysvshm

Environment

VariableValue
TERM linux
LD_LIBRARY_PATH /usr/local/apache_2.0.65/lib:
PATH /sbin:/usr/sbin:/bin:/usr/bin
PWD /
SHLVL 2
_ /usr/local/apache_2.0.65/bin/httpd

PHP Variables

VariableValue
PHP_SELF /linux/dbakorea/page11.htm
_SERVER["UNIQUE_ID"]9tjMWN5hvRQAAEZ3WY4AAAAE
_SERVER["GEOIP_ADDR"]210.90.202.19
_SERVER["GEOIP_CONTINENT_CODE"]AS
_SERVER["GEOIP_COUNTRY_CODE"]KR
_SERVER["GEOIP_COUNTRY_NAME"]Korea, Republic of
_SERVER["go_out"]1
_SERVER["HTTPS"]on
_SERVER["HTTP_ACCEPT"]text/html, application/xhtml+xml, */*
_SERVER["HTTP_REFERER"]https://www.linux.co.kr/linux/
_SERVER["HTTP_ACCEPT_LANGUAGE"]ko-KR
_SERVER["HTTP_USER_AGENT"]Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; SMJB; rv:11.0) like Gecko
_SERVER["HTTP_ACCEPT_ENCODING"]gzip, deflate
_SERVER["HTTP_HOST"]www.linux.co.kr
_SERVER["HTTP_DNT"]1
_SERVER["HTTP_CONNECTION"]Keep-Alive
_SERVER["HTTP_GEOIP_ADDR"]210.90.202.19
_SERVER["HTTP_GEOIP_CONTINENT_CODE"]AS
_SERVER["HTTP_GEOIP_COUNTRY_CODE"]KR
_SERVER["HTTP_GEOIP_COUNTRY_NAME"]Korea, Republic of
_SERVER["PATH"]/sbin:/usr/sbin:/bin:/usr/bin
_SERVER["SERVER_SIGNATURE"]<address>Apache/2.0.65 (Unix) mod_ssl/2.0.65 OpenSSL/1.0.0-fips PHP/4.4.9 Server at www.linux.co.kr Port 443</address>
_SERVER["SERVER_SOFTWARE"]Apache/2.0.65 (Unix) mod_ssl/2.0.65 OpenSSL/1.0.0-fips PHP/4.4.9
_SERVER["SERVER_NAME"]www.linux.co.kr
_SERVER["SERVER_ADDR"]222.97.189.20
_SERVER["SERVER_PORT"]443
_SERVER["REMOTE_ADDR"]210.90.202.19
_SERVER["DOCUMENT_ROOT"]/home/su/www
_SERVER["SERVER_ADMIN"]you@example.com
_SERVER["SCRIPT_FILENAME"]/home/su/www/linux/dbakorea/page11.htm
_SERVER["REMOTE_PORT"]63550
_SERVER["GATEWAY_INTERFACE"]CGI/1.1
_SERVER["SERVER_PROTOCOL"]HTTP/1.1
_SERVER["REQUEST_METHOD"]GET
_SERVER["QUERY_STRING"]no value
_SERVER["REQUEST_URI"]/linux/dbakorea/page11.htm
_SERVER["SCRIPT_NAME"]/linux/dbakorea/page11.htm
_SERVER["PHP_SELF"]/linux/dbakorea/page11.htm
_SERVER["PATH_TRANSLATED"]/home/su/www/linux/dbakorea/page11.htm
_SERVER["argv"]
Array
(
)
_SERVER["argc"]0
_ENV["TERM"]linux
_ENV["LD_LIBRARY_PATH"]/usr/local/apache_2.0.65/lib:
_ENV["PATH"]/sbin:/usr/sbin:/bin:/usr/bin
_ENV["PWD"]/
_ENV["SHLVL"]2
_ENV["_"]/usr/local/apache_2.0.65/bin/httpd

PHP License

This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.


정상적이라면 다음과 같은 메시지가 보일 것이다. This program makes use of the Zend scripting language engine: Zend Engine v1.0.6, Copyright (c) 1998-2001 Zend Technologies with Zend Optimizer v1.1.0, Copyright (c) 1998-2000, by Zend Technologies 설치 [root@ns src]# cd apache_1.3.20/ [root@ns apache_1.3.20]# ./configure --prefix=/usr/local/apache [root@ns php-4.0.6]# ./configure \ > --with-apache=../apache_1.3.20 \ > --with-mysql \ > --disable-debug [root@ns php-4.0.6]# make; make install [root@ns php-4.0.6]# cp php.ini-dist /usr/local/lib/php.ini [root@ns php-4.0.6]# cd ../apache_1.3.20/ [root@ns apache_1.3.20]# ./configure --prefix=/usr/local/apache \ > --activate-module=src/modules/php4/libphp4.a \ > --enable-module=so [root@ns apache_1.3.20]# make; make install [root@ns apache_1.3.20]# cd /usr/local/src/ZendOptimizer-1.1.0-PHP_4.0.5-Linux_glibc21-i386/ [root@ns ZendOptimizer-1.1.0-PHP_4.0.5-Linux_glibc21-i386]# cp ZendOptimizer.so /usr/local/lib [root@ns ZendOptimizer-1.1.0-PHP_4.0.5-Linux_glibc21-i386]# cd /usr/local/lib [php.ini] 2줄을 추가 zend_optimizer.optimization_level=15 zend_extension="/usr/local/lib/ZendOptimizer.so" [httpd.conf] AddType application/x-httpd-php .php <-이부분을 주석해제

'서버' 카테고리의 다른 글

리눅스 서버  (0) 2017.12.01
리눅스 서버  (0) 2017.12.01
리눅스 서버  (0) 2017.12.01
리눅스 서버  (0) 2017.12.01
리눅스 서버  (0) 2017.12.01
Comments