php 소스컴파일 설치 with_mysql 옵션

kohran의 이미지

검색해봐도 정보를 찾을 수 없기에 글 올려봅니다. (이노무 즈질 검색 실력..ㅜㅜ)

용도 : 웹서버
OS : CentOS 5.9
apache 2.2
php 5.2.9 설치하였습니다.

일단 Mysql은 서버를 따로 두었습니다.

apache 설치 후 php 설치를 하였습니다.

컴파일 옵션

/configure --with-apxs2=/usr/local/apache/bin/apxs --enable-mod-charset --with-config-file-path=/usr/local/apache/conf --enable-safe-mode --enable-sigchild --enable-magic-quotes --with-libxml-dir --with-openssl --with-zlib --with-zlib-dir --with-bz2 --enable-calendar --with-curl --enable-dba --with-gdbm --enable-exif --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-ttf --with-freetype-dir --enable-gd-native-ttf --with-gettext --with-imap --with-imap-ssl --with-kerberos --enable-mbstring --with-mhash --with-mcrypt=/usr/lib --enable-sockets --with-regex=php --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --enable-zend-multibyte --with-ldap

DB서버를 따로 두었으니 with_mysql 옵션은 주지 않았습니다.
php 소스에서 mysql_connect 함수가 undefined 되었다고 에러가 납니다.

함수가 정의되지 않았다고 뜨니 with_mysql 옵션을 넣을려고 하는데
mysql이 설치되지 않아 with_mysql 해당 옵션부분에서 에러가 납니다.

해당 옵션을 활성화 하려면 mysql-server를 꼭 설치해야 하는지요??
설치 안해도 가능한 방법이 있다면 알려주시면 감사하겠습니다.

elflord의 이미지

MySQL서버를 외부에 둔다고 해도 그 서버에 접속하기 위해 MySQL클라이언트는 설치하셔야 할텐데 이점 어떤 상황인가요?


===== ===== ===== ===== =====
그럼 이만 총총...[竹]
http://elflord.egloos.com

kohran의 이미지

mysql 클라이언트는 설치 되어있습니다.

mysql-server설치룰 안하고 with_mysql 옵션을 넣어 컴파일을 에러안나고 할 수 있는지 문의하는 겁니다.
제 설명이 부족했군요;;

trim703의 이미지

MySQL 클라이언트가 설치되어 있다고요? 혹시 rpm 을 말씀하시는 건 아닌지요?

MySQL 소스나 바이너리를 가져다 설치하면 server, client 통으로 다 설치됩니다. 컴파일 설치할 경우는 MySQL client용 바이너리/라이브러리/conf 파일만을 설치할 수 있게 하지 않습니다. 결국 MySQL을 별도 서버에 분리하여 설계한다 하더라도 php가 설치된 서버에도 MySQL을 통으로 다 설치해야 하고 php 컴파일 시 --with-mysql 옵션을 주어야 합니다.

kohran의 이미지

설명이 장황한거 같아서 간단하게 설명 드리자면

웹, DB 서버를 따로 쓰는데 웹서버에서 mysq-server 설치를 하지 않고
php 컴파일 옵션 중 --with_mysql 옵션의 경로를 어떻게 줘서 활성화 해야하는지 궁금합니다.
mysql 클라이언트 프로그램은 yum 으로 설치했습니다.

참고로 경로 안주고 그냥 --with_mysql 로 주고 했더니 에러가 납니다;

elflord의 이미지

그냥 mysql-server패키지를 까시는게 제일 간단할 것 같습니다만 꼭 설치하지 않기를 원하신다면 다음 사이트와 같이 mysqli extension을 쓰시는 방법이 참고가 될듯 합니다.

http://stackoverflow.com/questions/13983542/install-php-mysqli-extension-without-installing-mysql-server


===== ===== ===== ===== =====
그럼 이만 총총...[竹]
http://elflord.egloos.com

devunt의 이미지

--with-mysql= 인자로 mysql_config의 경로를 주시면 자동으로 mysql 포함해서 php를 컴파일하게 됩니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.