banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix Cài PHP 4.4.3 bị báo lỗi, help me  XML
  [Question]   Cài PHP 4.4.3 bị báo lỗi, help me 07/08/2006 03:19:57 (+0700) | #1 | 12766
vietwow
Member

[Minus]    0    [Plus]
Joined: 28/06/2006 13:15:47
Messages: 90
Offline
[Profile] [PM]
Mình build & íntall xong apache 2.0.59 (nằm trong thư mục /usr/local/vietwow) thì tiếp tục build & install php 4.4.3 nhưng khi chạy lệnh :

sudo ./configure --enable-safe-mod --with-apxs=/usr/local/vietwow/bin/apxs --prefix=/usr/local/vietwow/php

Thì nó báo lỗi :

vsec@vsec18-nix:~/Desktop/php-4.4.3$ sudo make
/bin/sh /home/vsec/Desktop/php-4.4.3/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/ftp/ -I/home/vsec/Desktop/php-4.4.3/ext/ftp/ -DPHP_ATOM_INC -I/home/vsec/Desktop/php-4.4.3/include -I/home/vsec/Desktop/php-4.4.3/main -I/home/vsec/Desktop/php-4.4.3 -I/home/vsec/Desktop/php-4.4.3/ext/xml/expat -I/home/vsec/Desktop/php-4.4.3/TSRM -I/home/vsec/Desktop/php-4.4.3/Zend -g -O2 -prefer-non-pic -c /home/vsec/Desktop/php-4.4.3/ext/ftp/php_ftp.c -o ext/ftp/php_ftp.lo
/bin/sh /home/vsec/Desktop/php-4.4.3/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/ftp/ -I/home/vsec/Desktop/php-4.4.3/ext/ftp/ -DPHP_ATOM_INC -I/home/vsec/Desktop/php-4.4.3/include -I/home/vsec/Desktop/php-4.4.3/main -I/home/vsec/Desktop/php-4.4.3 -I/home/vsec/Desktop/php-4.4.3/ext/xml/expat -I/home/vsec/Desktop/php-4.4.3/TSRM -I/home/vsec/Desktop/php-4.4.3/Zend -g -O2 -prefer-non-pic -c /home/vsec/Desktop/php-4.4.3/ext/ftp/ftp.c -o ext/ftp/ftp.lo
/bin/sh /home/vsec/Desktop/php-4.4.3/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/standard/ -I/home/vsec/Desktop/php-4.4.3/ext/standard/ -DPHP_ATOM_INC -I/home/vsec/Desktop/php-4.4.3/include -I/home/vsec/Desktop/php-4.4.3/main -I/home/vsec/Desktop/php-4.4.3 -I/home/vsec/Desktop/php-4.4.3/ext/xml/expat -I/home/vsec/Desktop/php-4.4.3/TSRM -I/home/vsec/Desktop/php-4.4.3/Zend -g -O2 -prefer-non-pic -c /home/vsec/Desktop/php-4.4.3/ext/standard/info.c -o ext/standard/info.lo
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c: In function 'php_info_write_wrapper':
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c:69: warning: pointer targets in passing argument 1 of 'php_escape_html_entities' differ in signedness
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c: In function 'php_info_html_esc':
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c:216: warning: pointer targets in passing argument 1 of 'php_escape_html_entities' differ in signedness
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c: In function 'php_print_info':
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c:505: warning: pointer targets in passing argument 3 of 'zend_hash_get_current_key_ex' differ in signedness
/bin/sh /home/vsec/Desktop/php-4.4.3/libtool --silent --preserve-dup-deps --mode=compile gcc -I/usr/local/vietwow/include -Isapi/apache/ -I/home/vsec/Desktop/php-4.4.3/sapi/apache/ -DPHP_ATOM_INC -I/home/vsec/Desktop/php-4.4.3/include -I/home/vsec/Desktop/php-4.4.3/main -I/home/vsec/Desktop/php-4.4.3 -I/home/vsec/Desktop/php-4.4.3/ext/xml/expat -I/home/vsec/Desktop/php-4.4.3/TSRM -I/home/vsec/Desktop/php-4.4.3/Zend -g -O2 -prefer-non-pic -c /home/vsec/Desktop/php-4.4.3/sapi/apache/sapi_apache.c -o sapi/apache/sapi_apache.lo
/home/vsec/Desktop/php-4.4.3/sapi/apache/sapi_apache.c: In function 'apache_php_module_main':
/home/vsec/Desktop/php-4.4.3/sapi/apache/sapi_apache.c:45: error: 'NOT_FOUND' undeclared (first use in this function)
/home/vsec/Desktop/php-4.4.3/sapi/apache/sapi_apache.c:45: error: (Each undeclared identifier is reported only once
/home/vsec/Desktop/php-4.4.3/sapi/apache/sapi_apache.c:45: error: for each function it appears in.)
make: *** [sapi/apache/sapi_apache.lo] Error 1

Vậy là sao? ai biết xin giúp mình với. Thanks
[Up] [Print Copy]
  [Question]   Re: Cài PHP 4.4.3 bị báo lỗi, help me 07/08/2006 07:12:12 (+0700) | #2 | 12815
subnetwork
Member

[Minus]    0    [Plus]
Joined: 05/09/2004 06:08:09
Messages: 1666
Offline
[Profile] [PM] [WWW] [Yahoo!]
Phóng lệnh này khi cài đặt Apache 2.X trên console thử xem bạn
# ./configure --with-mpm=worker --enable-rewrite -enable-module=so --enable-shared=yes
 


Phóng lệnh này khi cài đặt PHP 4.X trên console thử xem bạn
./configure --with-apxs2=/usr/local/vietwow/apache2/bin/apxs --with-pgsql --without-mysql \
--with-dom --with-xml --with-zlib --enable-mbstring --enable-mbregex \
--with-imap --enable-versioning --enable-zend-multibyte 


Nhìn lỗi mà bạn ghi tôi nghĩ nó là do dòng -enable-module=so và để ý đường dẫn của nó nhé .

#make
#make install
#/usr/local/apache2/bin/apachectl restart 


# vi phpinfo.php

<?
       phpinfo(Vo hien yeu dau cua anh oi, he he);
?> 


Chạy file phpinfo.php này xem có lỗi gì xuất hiện hay không ? Kiểm tra các dịch vụ xem có OK rồi hay chưa ?

Thân
Quản lý máy chủ, cài đặt, tư vấn, thiết kế, bảo mật hệ thống máy chủ dùng *nix
http://chamsocmaychu.com
[Up] [Print Copy]
  [Question]   Cài PHP 4.4.3 bị báo lỗi, help me 07/08/2006 10:08:15 (+0700) | #3 | 12849
[Avatar]
tranvanminh
HVA Friend

Joined: 04/06/2003 06:36:35
Messages: 516
Location: West coast
Offline
[Profile] [PM]

vietwow wrote:
Mình build & íntall xong apache 2.0.59 (nằm trong thư mục /usr/local/vietwow) thì tiếp tục build & install php 4.4.3 nhưng khi chạy lệnh :

sudo ./configure --enable-safe-mod --with-apxs=/usr/local/vietwow/bin/apxs --prefix=/usr/local/vietwow/php

Thì nó báo lỗi :

vsec@vsec18-nix:~/Desktop/php-4.4.3$ sudo make
/bin/sh /home/vsec/Desktop/php-4.4.3/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/ftp/ -I/home/vsec/Desktop/php-4.4.3/ext/ftp/ -DPHP_ATOM_INC -I/home/vsec/Desktop/php-4.4.3/include -I/home/vsec/Desktop/php-4.4.3/main -I/home/vsec/Desktop/php-4.4.3 -I/home/vsec/Desktop/php-4.4.3/ext/xml/expat -I/home/vsec/Desktop/php-4.4.3/TSRM -I/home/vsec/Desktop/php-4.4.3/Zend -g -O2 -prefer-non-pic -c /home/vsec/Desktop/php-4.4.3/ext/ftp/php_ftp.c -o ext/ftp/php_ftp.lo
/bin/sh /home/vsec/Desktop/php-4.4.3/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/ftp/ -I/home/vsec/Desktop/php-4.4.3/ext/ftp/ -DPHP_ATOM_INC -I/home/vsec/Desktop/php-4.4.3/include -I/home/vsec/Desktop/php-4.4.3/main -I/home/vsec/Desktop/php-4.4.3 -I/home/vsec/Desktop/php-4.4.3/ext/xml/expat -I/home/vsec/Desktop/php-4.4.3/TSRM -I/home/vsec/Desktop/php-4.4.3/Zend -g -O2 -prefer-non-pic -c /home/vsec/Desktop/php-4.4.3/ext/ftp/ftp.c -o ext/ftp/ftp.lo
/bin/sh /home/vsec/Desktop/php-4.4.3/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/standard/ -I/home/vsec/Desktop/php-4.4.3/ext/standard/ -DPHP_ATOM_INC -I/home/vsec/Desktop/php-4.4.3/include -I/home/vsec/Desktop/php-4.4.3/main -I/home/vsec/Desktop/php-4.4.3 -I/home/vsec/Desktop/php-4.4.3/ext/xml/expat -I/home/vsec/Desktop/php-4.4.3/TSRM -I/home/vsec/Desktop/php-4.4.3/Zend -g -O2 -prefer-non-pic -c /home/vsec/Desktop/php-4.4.3/ext/standard/info.c -o ext/standard/info.lo
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c: In function 'php_info_write_wrapper':
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c:69: warning: pointer targets in passing argument 1 of 'php_escape_html_entities' differ in signedness
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c: In function 'php_info_html_esc':
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c:216: warning: pointer targets in passing argument 1 of 'php_escape_html_entities' differ in signedness
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c: In function 'php_print_info':
/home/vsec/Desktop/php-4.4.3/ext/standard/info.c:505: warning: pointer targets in passing argument 3 of 'zend_hash_get_current_key_ex' differ in signedness
/bin/sh /home/vsec/Desktop/php-4.4.3/libtool --silent --preserve-dup-deps --mode=compile gcc -I/usr/local/vietwow/include -Isapi/apache/ -I/home/vsec/Desktop/php-4.4.3/sapi/apache/ -DPHP_ATOM_INC -I/home/vsec/Desktop/php-4.4.3/include -I/home/vsec/Desktop/php-4.4.3/main -I/home/vsec/Desktop/php-4.4.3 -I/home/vsec/Desktop/php-4.4.3/ext/xml/expat -I/home/vsec/Desktop/php-4.4.3/TSRM -I/home/vsec/Desktop/php-4.4.3/Zend -g -O2 -prefer-non-pic -c /home/vsec/Desktop/php-4.4.3/sapi/apache/sapi_apache.c -o sapi/apache/sapi_apache.lo
/home/vsec/Desktop/php-4.4.3/sapi/apache/sapi_apache.c: In function 'apache_php_module_main':
/home/vsec/Desktop/php-4.4.3/sapi/apache/sapi_apache.c:45: error: 'NOT_FOUND' undeclared (first use in this function)
/home/vsec/Desktop/php-4.4.3/sapi/apache/sapi_apache.c:45: error: (Each undeclared identifier is reported only once
/home/vsec/Desktop/php-4.4.3/sapi/apache/sapi_apache.c:45: error: for each function it appears in.)
make: *** [sapi/apache/sapi_apache.lo] Error 1

Vậy là sao? ai biết xin giúp mình với. Thanks 


Chạy lệnh này thử xem được không ?
sudo ./configure --with-apxs=/usr/local/vietwow/bin/apxs --prefix=/usr/local/vietwow/php
 


Còn nếu không đựợc thì lão copy hết nội dung file config.nice trong directory chứa source apache lên luôn xem thử ?

Còn không được nữa thì dùng phiên bản khác thử luôn xem ?
[Up] [Print Copy]
  [Question]   Cài PHP 4.4.3 bị báo lỗi, help me 07/08/2006 11:26:27 (+0700) | #4 | 12886
[Avatar]
tranvanminh
HVA Friend

Joined: 04/06/2003 06:36:35
Messages: 516
Location: West coast
Offline
[Profile] [PM]

dotNET wrote:
Hô hô, bác này chắc là học viên của vsec đang mò trong phòng lab. vsec chắc là không ai biết cài php, hehe. 


Bài đầu tiên đã thế thì không biết sau này thế nào ? bạn dotNET vui lòng quay về link dưới đọc nội qui trước khi post bài :wink:

http://hvaforum.net/hvaonline/posts/list/110.html#422


[Up] [Print Copy]
  [Question]   Re: Cài PHP 4.4.3 bị báo lỗi, help me 07/08/2006 23:43:34 (+0700) | #5 | 12974
vietwow
Member

[Minus]    0    [Plus]
Joined: 28/06/2006 13:15:47
Messages: 90
Offline
[Profile] [PM]
Thank 2 bác, đã thử cách của cả 2 bác nhưng đều bị y chang vậy, thậm chí mình đã thử bỏ bớt nhiều module trong lúc build mà vẫn bị vậy smilie(

Đây là nội dung file config.nice của mình :

#! /bin/sh
#
# Created by configure

"./configure" \
"--prefix=/usr/local/vietwow" \
"--enable-rewrite" \
"$@"
[Up] [Print Copy]
  [Question]   Re: Cài PHP 4.4.3 bị báo lỗi, help me 07/08/2006 23:47:12 (+0700) | #6 | 12975
[Avatar]
tranvanminh
HVA Friend

Joined: 04/06/2003 06:36:35
Messages: 516
Location: West coast
Offline
[Profile] [PM]
Lão dùng phiên bản khác thử xem ? vẩn không được luôn ?
[Up] [Print Copy]
  [Question]   Re: Cài PHP 4.4.3 bị báo lỗi, help me 08/08/2006 00:42:02 (+0700) | #7 | 12987
vietwow
Member

[Minus]    0    [Plus]
Joined: 28/06/2006 13:15:47
Messages: 90
Offline
[Profile] [PM]
Mình mới thử dơn bản php 5 mới nhất về cài, vẫn lỗi y chang vậy T_T

Copy đoạn cuối bị lỗi lúc make cho mọi người xem :

-I/usr/include -g -O2 -prefer-non-pic -c /root/Desktop/php-5.1.4/sapi/apache/sapi_apache.c -o sapi/apache/sapi_apache.lo
/root/Desktop/php-5.1.4/sapi/apache/sapi_apache.c: In function 'apache_php_module_main':
/root/Desktop/php-5.1.4/sapi/apache/sapi_apache.c:44: error: 'NOT_FOUND' undeclared (first use in this function)
/root/Desktop/php-5.1.4/sapi/apache/sapi_apache.c:44: error: (Each undeclared identifier is reported only once
/root/Desktop/php-5.1.4/sapi/apache/sapi_apache.c:44: error: for each function it appears in.)
make: *** [sapi/apache/sapi_apache.lo] Error 1

Chẳng lẽ là do lỗi của thằng apache ?
[Up] [Print Copy]
  [Question]   Re: Cài PHP 4.4.3 bị báo lỗi, help me 08/08/2006 01:16:59 (+0700) | #8 | 12997
prof
Moderator

Joined: 23/11/2004 01:08:55
Messages: 205
Offline
[Profile] [PM]

vietwow wrote:
Mình mới thử dơn bản php 5 mới nhất về cài, vẫn lỗi y chang vậy T_T

Copy đoạn cuối bị lỗi lúc make cho mọi người xem :

-I/usr/include -g -O2 -prefer-non-pic -c /root/Desktop/php-5.1.4/sapi/apache/sapi_apache.c -o sapi/apache/sapi_apache.lo
/root/Desktop/php-5.1.4/sapi/apache/sapi_apache.c: In function 'apache_php_module_main':
/root/Desktop/php-5.1.4/sapi/apache/sapi_apache.c:44: error: 'NOT_FOUND' undeclared (first use in this function)
/root/Desktop/php-5.1.4/sapi/apache/sapi_apache.c:44: error: (Each undeclared identifier is reported only once
/root/Desktop/php-5.1.4/sapi/apache/sapi_apache.c:44: error: for each function it appears in.)
make: *** [sapi/apache/sapi_apache.lo] Error 1

Chẳng lẽ là do lỗi của thằng apache ?
 

Hello vietwow,

Bạn thử thêm các dòng sau vào file include/httpd.h của Apache rồi compile lại xem nhé.
Code:
#define DOCUMENT_FOLLOWS    HTTP_OK
#define PARTIAL_CONTENT     HTTP_PARTIAL_CONTENT
#define MULTIPLE_CHOICES    HTTP_MULTIPLE_CHOICES
#define MOVED               HTTP_MOVED_PERMANENTLY
#define REDIRECT            HTTP_MOVED_TEMPORARILY
#define USE_LOCAL_COPY      HTTP_NOT_MODIFIED
#define BAD_REQUEST         HTTP_BAD_REQUEST
#define AUTH_REQUIRED       HTTP_UNAUTHORIZED
#define FORBIDDEN           HTTP_FORBIDDEN
#define NOT_FOUND           HTTP_NOT_FOUND
#define METHOD_NOT_ALLOWED  HTTP_METHOD_NOT_ALLOWED
#define NOT_ACCEPTABLE      HTTP_NOT_ACCEPTABLE
#define LENGTH_REQUIRED     HTTP_LENGTH_REQUIRED
#define PRECONDITION_FAILED HTTP_PRECONDITION_FAILED
#define SERVER_ERROR        HTTP_INTERNAL_SERVER_ERROR
#define NOT_IMPLEMENTED     HTTP_NOT_IMPLEMENTED
#define BAD_GATEWAY         HTTP_BAD_GATEWAY
#define VARIANT_ALSO_VARIES HTTP_VARIANT_ALSO_VARIES

Lưu ý: bạn thêm phần này vào ngay sau phần #define cho httd response code nhé (sau line 485).

Chúc bạn thành công smilie
[Up] [Print Copy]
  [Question]   Cài PHP 4.4.3 bị báo lỗi, help me 08/08/2006 02:31:07 (+0700) | #9 | 13012
subnetwork
Member

[Minus]    0    [Plus]
Joined: 05/09/2004 06:08:09
Messages: 1666
Offline
[Profile] [PM] [WWW] [Yahoo!]
Có thể do apache phiên bản này không tương thích với Php 4.x vì đây là Apache 2.x cho nên bạn sử dụng là --with-apxs2 (đường dẫn của nó nằm ở /usr/sbin/apxs2)

Bạn xem ở đây thử
http://www.php.net/manual/en/install.unix.apache2.php

Nếu không được nữa, bạn vào Apache, download phiên bản mới nhất về Apache 2.2.3 built lại apache xem (trước khi gặp lỗi này bạn có thay đổi tập tin httpd.conf hay không vậy)

Thân
Quản lý máy chủ, cài đặt, tư vấn, thiết kế, bảo mật hệ thống máy chủ dùng *nix
http://chamsocmaychu.com
[Up] [Print Copy]
  [Question]   Re: Cài PHP 4.4.3 bị báo lỗi, help me 08/08/2006 03:00:27 (+0700) | #10 | 13017
vietwow
Member

[Minus]    0    [Plus]
Joined: 28/06/2006 13:15:47
Messages: 90
Offline
[Profile] [PM]
Sau khi làm theo chỉ dẫn của bạn Prof, khi make lại php thì lần này nó lại báo lỗi khác :

/home/vsec/Desktop/php-4.4.3/sapi/apache/mod_php4.c:956: warning: (near initiali zation for 'php4_module')
/home/vsec/Desktop/php-4.4.3/sapi/apache/mod_php4.c:959: warning: excess element s in struct initializer
/home/vsec/Desktop/php-4.4.3/sapi/apache/mod_php4.c:959: warning: (near initiali zation for 'php4_module')
/home/vsec/Desktop/php-4.4.3/sapi/apache/mod_php4.c:961: warning: excess element s in struct initializer
/home/vsec/Desktop/php-4.4.3/sapi/apache/mod_php4.c:961: warning: (near initiali zation for 'php4_module')
make: *** [sapi/apache/mod_php4.lo] Error 1

Source apache này, mình down về chỉ sửa duy nhất trong file ap.release để đổi tên webserver và sửa lại phiên bản để người khác request đến ko bít thông tin về webserver thôi, chứ ko có sửa gì nhiều

To GA : Cái apache này ngộ ghê, rõ ràng là mình down bản 2.0.59 về (đã check kỹ lại trong source) và lúc ./configure --with-apxs2 thì nó báo lỗi bảo là mình đang xài apache 1x nên ko dùng được chức năng này, khi mình đổi lại --with-apxs (dành cho apache 1.x) thì lại build tốt, pó tay
[Up] [Print Copy]
  [Question]   Re: Cài PHP 4.4.3 bị báo lỗi, help me 08/08/2006 06:09:18 (+0700) | #11 | 13068
subnetwork
Member

[Minus]    0    [Plus]
Joined: 05/09/2004 06:08:09
Messages: 1666
Offline
[Profile] [PM] [WWW] [Yahoo!]
Tôi nghĩ do module này chưa được nạp cho nên có vấn đề khi cài đặt Php . OK ta sẽ thực hiện trở lại với việc cấu hình Apache, bây giờ bạn mở httpd.conf.
Tìm dòng AddModule thêm vào dòng
AddModule mod_php4.c //Nếu dùng PHP4.x (kiểm tra Module này luôn , nếu module này xuất hiện ở đường dẫn /apache/modules thì thay thế nó thành /apache/modules/mod_php4.c)

Tìm dòng AddType thêm vào dòng sau
AddType application/x-httpd-php .php // Dành cho PHP 4.x

Tìm dòng
LoadModule php4_module libexec/libphp4.so (kiểm tra đường dẫn của libphp4.so)

Tìm dòng DiectoryIndex thay thế nó thành dòng sau
DirectoryIndex index.php default.php index.html index.htm

Start Apache xem có OK hay không ?
Nếu có lỗi ở phần này thì kiểm tra lại các module (đường dẫn)
Quan trọng ở file httpd.conf nếu như xuất hiện dấu # ở dòng AddModule hay các dòng khác thì xoá bỏ dấu # này đi .

Thân mến
Quản lý máy chủ, cài đặt, tư vấn, thiết kế, bảo mật hệ thống máy chủ dùng *nix
http://chamsocmaychu.com
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|