Programming/php2014. 10. 21. 15:01
원인불명으로.. 실행이 안되서 여전히 고민..
일단 php-cgi를 재컴파일 해서 바꿔치기 해서
php-cgi 자체의 소유권 때문인가 싶어서 테스트 해봤지만
php-cgi가 root:root 던 www:www던 둘다 상관없이 안되므로 패스..


srwxr-xr-x    1 www      www             0 Jan  1 09:00 php.sock-0 

lighttpd.log 에서는 아래와 같이 에러가 발생한다.
1970-01-01 09:00:25: (log.c.166) server started
1970-01-01 09:00:25: (mod_fastcgi.c.977) bind failed for: unix:/tmp/php.sock-0 Permission denied
1970-01-01 09:00:25: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi failed.
1970-01-01 09:00:25: (server.c.964) Configuration of plugins failed. Going down.

일단.. 임시 방책으로
mkdir /tmp/www
chown www:www /tmp/www
으로 회피 -_- 

'Programming > php' 카테고리의 다른 글

php simpleXML  (0) 2014.12.22
xcache 1.3.2 for php 5.3.22 for ARM  (0) 2014.11.11
php.ini extension_dir  (0) 2014.10.20
php 5.3.22 / xcache 1.3.2  (0) 2014.10.15
php 5.5.17 opcache / arm  (0) 2014.10.14
Posted by 구차니
Programming/php2014. 10. 20. 11:03
configure를 다시 뒤져봐도 컴파일시 지정하지 못했던 부분인데 어디서 나오는건지..

phpinfo()에서 extension_dir을 보면
php 5.3.22 기준 아래의 경로를 찍어 주는데
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/

lighttpd -m/usr/lib를 해주어도 위의 경로에 무조건! 넣어 주어야 extension이 작동한다
일단.. 경로가 괴랄하니..

php.ini 에다가 
extension_dir = "/usr/lib" 라고 해주면 깔끔(?)하게 끝!

extension_dir
In what directory PHP should look for dynamically loadable extensions. See also: enable_dl, and dl().
 
[링크 : http://php.net/manual/en/ini.core.php#ini.extension-dir]

'Programming > php' 카테고리의 다른 글

xcache 1.3.2 for php 5.3.22 for ARM  (0) 2014.11.11
lighttpd + php 퍼미션 문제  (0) 2014.10.21
php 5.3.22 / xcache 1.3.2  (0) 2014.10.15
php 5.5.17 opcache / arm  (0) 2014.10.14
php - extensions are not supported on this platform / arm  (0) 2014.10.14
Posted by 구차니
Programming/web 관련2014. 10. 20. 09:46

먼가 테스트 하다보니..
Firefox에서 이런 메타 태그가 보여서 성능 향상에 영향을 미칠까 하고 검색을 해보았지만..



CACHE-CONTROL
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
HTTP 1.1. Allowed values = PUBLIC | PRIVATE | NO-CACHE | NO-STORE. 
 
Public - may be cached in public shared caches 
Private - may only be cached in private cache 
no-Cache - may not be cached 
no-Store - may be cached but not archived

The directive CACHE-CONTROL:NO-CACHE indicates cached information should not be used and instead requests should be forwarded to the origin server. This directive has the same semantics as the PRAGMA:NO-CACHE. 
Clients SHOULD include both PRAGMA:NO-CACHE and CACHE-CONTROL:NO-CACHE when a no-cache request is sent to a server not known to be HTTP/1.1 compliant. 
Also see EXPIRES. 
Note: It may be better to specify cache commands in HTTP than in META statements, where they can influence more than the browser, but proxies and other intermediaries that may cache information.
[링크 : http://www.i18nguy.com/markup/metatags.html]  

정적 데이터에는 유효하나(캐싱된거 다시 쓰니)
동적 데이터(php 라던가?)는 이래저래 의미가 없을 듯 하다.
[링크 : http://blog.saltfactory.net/202]

'Programming > web 관련' 카테고리의 다른 글

웹소켓(websocket)  (0) 2015.01.07
html / input type radio에서의 reset 처리  (0) 2015.01.06
aptana / eclipse  (0) 2014.08.25
node.js  (0) 2014.07.07
부트스트랩 - 웹개발 프레임워크  (0) 2014.07.07
Posted by 구차니
Programming/php2014. 10. 15. 15:45
Zend opcache에 실패하고 뱅글뱅글 돌아 다시 컴백...
일단 arm용 lighttpd에서 쑈하다가 또 다시 벽에 부딛힌.. ㅠㅠ

[링크 : http://xcache.lighttpd.net/wiki/Faq]

'Programming > php' 카테고리의 다른 글

lighttpd + php 퍼미션 문제  (0) 2014.10.21
php.ini extension_dir  (0) 2014.10.20
php 5.5.17 opcache / arm  (0) 2014.10.14
php - extensions are not supported on this platform / arm  (0) 2014.10.14
php php-cgi 차이점?  (0) 2014.10.10
Posted by 구차니
Programming/php2014. 10. 14. 17:12
php 5.5 부터 Zend에서 기본 내장된 opcache라는 녀석이 있는데..
ARM에서 크로스 컴파일로 하려니

일단 dlopen 에서 패스를 하지 못해
extensions are not supported on this platform 이런 에러 발생..
이거야 configure에서 해당 부분을 강제로 스킵하게 하면 되지만

flock structure도 배를 째서..
그냥 강제로 flock_type=linux로 해서 컴파일 하는데 성공!

하지만 
정작 기능을 활성화 시키면
Fatal Error Unable to allocate shared memory segment of 8388608 bytes: unknown: Numerical result out of range (34)
에러를 발생한다.
opcache의 경우 opcache.memory_consumption 캐싱용량을 최소 8MB 이상으로 하기에 그 이하로 지정해도
무조건 8MB 이상으로 하기에 php.ini나 opcache.ini 에서 opcache.memory_consumption = 1M로 해도
뜬금없이 8MB로 나와서 헤메게 하는 부분.. -_-
그런 중요(?)한건 좀 메뉴얼에 제대로 명시하라고!! (디버깅 모드로 메시지 출력하도록 해서 발견)

opcache.memory_consumption integer
The size of the shared memory storage used by OPcache, in megabytes.
 
[링크 : http://php.net/manual/en/opcache.configuration.php] 

아무튼.. shared 메모리를 자꾸 외쳐서
/etc/sysctl.conf에서 설정해주고 리부팅 해도
이래저래 안되서.. 결론적으로 포기 ㅠㅠ

[링크 : https://www.msi.umn.edu/.../support/download/Linux_shared_mem_seg.html] shared memory
[링크 : http://pic.dhe.ibm.com/...com.ibm.swg.im.soliddb.accel.doc%2Fdoc%2Fsma.kernels.linux.html] sysctl
[링크 : http://stackoverflow.com/questions/17224798/how-to-use-php-opcache]
[링크 : https://github.com/zendtech/ZendOptimizerPlus/issues/134

'Programming > php' 카테고리의 다른 글

php.ini extension_dir  (0) 2014.10.20
php 5.3.22 / xcache 1.3.2  (0) 2014.10.15
php - extensions are not supported on this platform / arm  (0) 2014.10.14
php php-cgi 차이점?  (0) 2014.10.10
<? <?php 설정  (0) 2014.10.10
Posted by 구차니
Programming/php2014. 10. 14. 10:57
크로스컴파일 해서 넣는데
php / php-cgi를 실행하면 계속 확장기능을 쓸수 없다고 나와서
의아한 나머지 검색을 해보니

dlopen 이라는 녀석에서 no가 뜬다 -_-!!
Running system checks
checking for sendmail... no
checking whether system uses EBCDIC... no
checking whether byte ordering is bigendian... unknown
checking whether writing to stdout works... no
checking for socket... yes
checking for socketpair... yes
checking for htonl... yes
checking for gethostname... yes
checking for gethostbyaddr... yes
checking for yp_get_default_domain... no
checking for __yp_get_default_domain... no
checking for yp_get_default_domain in -lnsl... yes
checking for dlopen... no
checking for __dlopen... no
checking for dlopen in -ldl... yes 

소스를 뒤져보면.. dlopen이라는게 이렇게 있는데 
$ vi Zend/zend.h
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)

# ifndef RTLD_LAZY
#  define RTLD_LAZY 1    /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
# endif

# ifndef RTLD_GLOBAL
#  define RTLD_GLOBAL 0
# endif

# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
#  define DL_LOAD(libname)          dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
# elif defined(RTLD_DEEPBIND)
#  define DL_LOAD(libname)          dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
# else
#  define DL_LOAD(libname)          dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
# endif
# define DL_UNLOAD                  dlclose
# if defined(DLSYM_NEEDS_UNDERSCORE)
#  define DL_FETCH_SYMBOL(h,s)      dlsym((h), "_" s)
# else
#  define DL_FETCH_SYMBOL           dlsym
# endif
# define DL_ERROR                   dlerror
# define DL_HANDLE                  void *
# define ZEND_EXTENSIONS_SUPPORT    1
#elif defined(ZEND_WIN32)
# define DL_LOAD(libname)           LoadLibrary(libname)
# define DL_FETCH_SYMBOL            GetProcAddress
# define DL_UNLOAD                  FreeLibrary
# define DL_HANDLE                  HMODULE
# define ZEND_EXTENSIONS_SUPPORT    1
#else
# define DL_HANDLE                  void *
# define ZEND_EXTENSIONS_SUPPORT    0
#endif 

[링크 : http://www.opensource.apple.com/.../apache_mod_php-18.8/php/Zend/zend_extensions.c

*.so로 제공되는 확장기능을 당연히 dlopen()을 쓸수 없으면 dynamic linking을 쓸수 없기에 비활성화 되는 것 -_-
configure에서 강제로 해당 부분을 주석 처리하고 넘기는 수 밖에 없다. 
Name
dladdr, dlclose, dlerror, dlopen, dlsym, dlvsym - programming interface to dynamic linking loader

Synopsis
#include <dlfcn.h>
void *dlopen(const char *filename, int flag);
char *dlerror(void);
void *dlsym(void *handle, const char *symbol);
int dlclose(void *handle);

Link with -ldl.

[링크 : http://linux.die.net/man/3/dlopen

'Programming > php' 카테고리의 다른 글

php 5.3.22 / xcache 1.3.2  (0) 2014.10.15
php 5.5.17 opcache / arm  (0) 2014.10.14
php php-cgi 차이점?  (0) 2014.10.10
<? <?php 설정  (0) 2014.10.10
lighttpd + php-fpm  (0) 2014.10.10
Posted by 구차니
Programming/php2014. 10. 10. 16:58

php


php-cgi


php-cgi로 사용시에는
php를 강제로 바꿔치기 하면 위와 같이 텍스트로 깨져 나와버린다.

즉, php-cgi와 php는 비슷하지만 전혀 다른 결과물을 내는 별개의 프로그램이란 것 

'Programming > php' 카테고리의 다른 글

php 5.5.17 opcache / arm  (0) 2014.10.14
php - extensions are not supported on this platform / arm  (0) 2014.10.14
<? <?php 설정  (0) 2014.10.10
lighttpd + php-fpm  (0) 2014.10.10
php 5.3.22 버전 크로스컴파일시 주의사항  (0) 2014.10.08
Posted by 구차니
Programming/php2014. 10. 10. 14:49
기본값은
short_open_Tag = Off
(우분투 14.04 LTS / php5.5.9)

기본값이 Off 라서
<? phpinfo(); ?>가 실행이 안되었던 듯

일단 웹 표준(?) 문제나 파싱 문제로 인해서
기본은 Off 인 듯 하니 기억은 해둬야겠다 -_ㅠ

[링크 : http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=15692 ]
[링크 : http://php.net/manual/en/ini.core.php#ini.short-open-tag ]

'Programming > php' 카테고리의 다른 글

php - extensions are not supported on this platform / arm  (0) 2014.10.14
php php-cgi 차이점?  (0) 2014.10.10
lighttpd + php-fpm  (0) 2014.10.10
php 5.3.22 버전 크로스컴파일시 주의사항  (0) 2014.10.08
php - register_globals  (0) 2014.10.07
Posted by 구차니
Programming/php2014. 10. 10. 14:43
[링크 : http://www.howtoforge.com/installing-lighttpd-with-php5-php-fpm-and-mysql-support-on-ubuntu-12.04]
[링크:  http://stackoverflow.com/.../php-what-are-the-effects-of-cgi-fix-pathinfo-1-in-php-ini-on-a-webserver]


 $ sudo vi /etc/php5/fpm/pool.d/www.conf
 ;listen = /var/run/php5-fpm.sock
 listen=127.0.0.1:9000 

[링크 : http://docs.cubieboard.org/tutorials/common/applications/lighttpd_and_php-fpm ]

Server API - CGI/FastCGI

 
Server API - FPM/FastCGI

 

php를 /bin/php-cgi로 바인딩 되어 있으면
fpm 설정을 해놔도 무조건 fcgi로 연결된다.
그러니 fpm으로 사용시에는 cgi.assign 부분에서 php를 반드시 주석처리 해야 한다.

$ vi /etc/lighttpd.conf
server.modules              = (
                                "mod_alias",
                                "mod_access",
                                "mod_auth",
                                "mod_cgi",
                                "mod_fastcgi")

cgi.assign                 = ( ".pl"  => "/usr/bin/perl",
                               ".html" => "/usr/bin/php",
                               ".php" => "/bin/php-cgi",
                               ".cgi" => "" )

fastcgi.server = ( ".php" =>
        ((
                "host" => "127.0.0.1",
                "port" => "9000",
                "max-procs" => 1,
                "bin-environment" => (
                        "PHP_FCGI_CHILDREN" => "1",
                        "PHP_FCGI_MAX_REQUESTS" => "10000"),
        )) 
) 

'Programming > php' 카테고리의 다른 글

php php-cgi 차이점?  (0) 2014.10.10
<? <?php 설정  (0) 2014.10.10
php 5.3.22 버전 크로스컴파일시 주의사항  (0) 2014.10.08
php - register_globals  (0) 2014.10.07
php EGPCS  (0) 2014.10.07
Posted by 구차니
Programming/php2014. 10. 8. 09:15
config.cache를 반드시 지우고 할 것
안지우면 마지막 configure 설정이 유지된다.

'Programming > php' 카테고리의 다른 글

<? <?php 설정  (0) 2014.10.10
lighttpd + php-fpm  (0) 2014.10.10
php - register_globals  (0) 2014.10.07
php EGPCS  (0) 2014.10.07
php-fpm관련  (0) 2014.09.25
Posted by 구차니