SpyLOG
PHP-Nuke ��-������    �������
���������
��������
 ����
�������
����
 �������
������������
�������
 ������
�������
������
 �����
�������
��������
 �����
������������
�������
 �����
������
���������
������� ���
����� �����

����� 49. �������� ���������� ���

� ���� ������� ������� �������� ������, ����������� �� ����� ����������/build ���.

1. � ���� ��������� ������ PHP, ������������ ������ ���������� CVS, �� ��� ������� ������������!
2. � ���� �������� � ���������������� PHP ��� ������ � Apache. �� �������, ��� �� ����� ����� httpd.h, �� ��� ���� ��������� ���, ��� � ��� ������!
3. ����� � �������� configure, �� �������, ��� �� ����� ����� include-����� ��� ���������� ��� GD, gdbm ��� ��� ������-������ ������!
4. ��� ���������� ����� language-parser.tab.c  �� ����� ��� ������, ��� ���������, ��� yytname undeclared.
5. ����� � �������� make, �� ����� ��� ���������, �� ����� - ����� ��� ������� ���������� �������������� ����������, � �� ��������, ��� �� ����� ����� ��������� �����.
6. ��� ����������/linking PHP �� �������� �� ������� undefined-������.
7. � �� ���� ��������, ��� ��������� build PHP � Apache 1.3.
8. � �������� ��� ���� �� ��������� Apache-������ ������ ��� UNIX, � ��� PHP-������� ��������� � ��������, ��� ��� ������� ������, ��������� �� ����.
9. ������� ������������ --activate-module=src/modules/php4/libphp4.a, �� ���� ���� �� ����������, ������� � ������ ���� ������ --activate-module=src/modules/php4/libmodphp4.a, � �� �� ��������!? � ��� �������?
10. ����� � ������� ��������� Apache � PHP ��� static-������� ���� ������������� --activate-module=src/modules/php4/libphp4.a, �� ��� �������, ��� ��� ���������� ����������� � ANSI.
11. ����� � ������� ��������� PHP � �������������� --with-apxs, � ������� �������� ��������� �� �������.
12. � �������� make � ������� ������ � microtime � ����� RUSAGE_.
13. � ���� �������� ��� PHP. ��� � ���� ����� ������ ./configure, ������� �������������� ��� ���������� ��������� ���� ������� ������ PHP?

1. � ���� ��������� ������ PHP, ������������ ������ ���������� CVS, �� ��� ������� ������������!

��� ���������� ����� ������������� ����� GNU autoconf, ����� �� ����� ������������ ������ ������������ �� configure.in. ������ ��������� ./buildconf � ���������� �������� ������ ����� ��������� ���������� � CVS-�������. (�����, ���� �� �� ��������� configure � ������ --enable-maintainer-mode, ������ configure �� ����� ������������� ����������/rebuilt, ����� ���� configure.in �����������, ������� �� ����������� ������ ������� ��� �������, ���� configure.in ����������. ���� �� ��������� ����� - ���� �� �������� ���-������ ����� @VARIABLE@ � ����� Makefile ����� ���������������� ��� ���� config.status ��������.)

2. � ���� �������� � ���������������� PHP ��� ������ � Apache. �� �������, ��� �� ����� ����� httpd.h, �� ��� ���� ��������� ���, ��� � ��� ������!

�� ������ �������� configure/setup-������� ������������ �������� ������ ������ ������ ���������� Apache. ��� ��������, ��� �� ������ ��������������� --with-apache=/path/to/apache, � �� --with-apache=/path/to/apache/src.

3. ����� � �������� configure, �� �������, ��� �� ����� ����� include-����� ��� ���������� ��� GD, gdbm ��� ��� ������-������ ������!

�� ������ ������� ���, ����� configure-������ ����� header-����� � ���������� � ������������� �����, �������������� �������������� ����� ��� �������� �� ������������� C � ������������/linker ����� �������:
CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure

���� �� ����������� csh-������� ��� ����� �������� ������ (������?), ��� ����� ����:

env CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure

4. ��� ���������� ����� language-parser.tab.c  �� ����� ��� ������, ��� ���������, ��� yytname undeclared.

��� ���������� �������� ���� ������ Bison. �� ������ ����� ��������� ������ �� ������ ftp://ftp.gnu.org/pub/gnu/bison/

5. ����� � �������� make, �� ����� ��� ���������, �� ����� - ����� ��� ������� ���������� �������������� ����������, � �� ��������, ��� �� ����� ����� ��������� �����.

��������� ������ ������ make ����������� �������� ����������������� ������ ������ � functions-���������� � �� �� ����� ����������. ����������� ��������� cp *.o functions, � ����� ������������� make � ����������, ������� �� ���. ���� �������, ��� ������������� ���������� �������� �� ��������� ������ GNU make.

6. ��� ����������/linking PHP �� �������� �� ������� undefined-������.

���������� �� ������ ���������� � ���������, ��� ��� ����������� ���������� ���������� � �����. ������ �������� '-ldl' � ����� ����������, ����������� ��� ��������� ��� ������, ������� �� ��������.

���� �� ����������� � Apache 1.2.x, �� ������ �� �� �������� ������ ���������� � ������ EXTRA_LIBS Configuration-����� � ������������� Configure-������ Apache'�? ��. INSTALL-����, ������� ������������ � �������������.

������ ����� ��������, ��� ��� �������� '-ldl' ����� ����� libphp4.a ��� ���������� � Apache.

7. � �� ���� ��������, ��� ��������� build PHP � Apache 1.3.

��� � ���������������� �������� �����. ����������� ��������� ��������� ����:

  • �������� ��������� ����������� Apache 1.3 � http://www.apache.org/dist/.

  • Ungzip � untar ��� ���-������, ��������, � /usr/local/src/apache-1.3.

  • ������������� PHP, �������� ������� ./configure --with-apache=/<path>/apache-1.3 (�������� <path> �� �������� ���� � ����� ���������� apache-1.3.

  • ������� make � ����� make install ��� ����������/build PHP � ���������� ������ ����� � ������ ������������ Apache.

  • �������� ���������� �� ���� ���������� /<path>/apache-1.3/src � �������������� ���� Configuration. �������� � ���� ����: AddModule modules/php4/libphp4.a.

  • �������: ./Configure � ����������� make.

  • �� �� ������ ����� httpd binary � ���������� PHP!

����������: �� ������ ����� ������������ ����� Apache ./configure-������. �� ���������� � ����� README.configure, ������� �������� ������ ������ ������������ Apache. ����������� ����� ���� INSTALL � ������������ PHP.

8. � �������� ��� ���� �� ��������� Apache-������ ������ ��� UNIX, � ��� PHP-������� ��������� � ��������, ��� ��� ������� ������, ��������� �� ����.

��� ��������, ��� PHP-������ �� ���������� �� �����-�� �������.
��������� ��� ����, ������ ��� ��������� ���������� ������:

  • ���������, ��� httpd binary, ���������� � ���, ������������� �������� ����� httpd-����������, ������ ��� ����������� ����. ��� ����� ����������� ���������: /path/to/binary/httpd -l

    ���� �� �� ������ mod_php4.c, �� � ��� ������� �� ��� binary. ������� � ���������� ���������� binary.

  • ���������, ��� �� �������� ���������� Mime Type � ���� �� .conf-������ Apache. ��� ������ ����: AddType application/x-httpd-php3 .php3 (��� PHP 3)

    ��� AddType application/x-httpd-php .php (��� PHP 4)

    ����� ���������, ��� ��� ������ AddType �� �������� ������ ����� <Virtualhost> ��� <Directory>, ��� ������������� ��� ���������� � �������������� ������ ��������� �������.

  • �������, ���������� ����� ������������ Apache ���������� ��� ������ Apache 1.3. �� ������ ���������, ��� ���� ������������, � ������� �� �������� ������ AddType, ������������� ��������. �� ������ ��������� ��������� �������������� ������ � ���� httpd.conf ��� ������� �����-������ ���� ��������� ���������, ������� ������� ������, �������� �� ���� ���� ���������.

9. ������� ������������ --activate-module=src/modules/php4/libphp4.a, �� ���� ���� �� ����������, ������� � ������ ���� ������ --activate-module=src/modules/php4/libmodphp4.a, � �� �� ��������!? � ��� �������?

�������� ��������, ��� ������������� ����� libphp4.a �� ��������������. ������� �pache ������� ���!

10. ����� � ������� ��������� Apache � PHP ��� static-������� ���� ������������� --activate-module=src/modules/php4/libphp4.a, �� ��� �������, ��� ��� ���������� ����������� � ANSI.

��� �������� � ����������� ��������� �� ������ �� Apache, ������� ��������� � ����������� �������.

11. ����� � ������� ��������� PHP � �������������� --with-apxs, � ������� �������� ��������� �� �������.

����� ����� ��������� ��� ����. ��-������, �����, �� ��������� ��������, Apache ������ Perl-������ apxs, �� ������ ����������� ���������� ��� ������ ���������� ����������� � ������. ������� ��� ������ apxs (���������� ������� which apxs, ��� ����� ����� ��� � /usr/local/apache/bin/apxs ��� � /usr/sbin/apxs). �������� ��� � ��������� ������ ��������� ����:
my $CFG_CFLAGS_SHLIB  = ' ';          # �������� ����� Makefile.tmpl
my $CFG_LD_SHLIB      = ' ';          # �������� ����� Makefile.tmpl
my $CFG_LDFLAGS_SHLIB = ' ';          # �������� ����� Makefile.tmpl

���� �� ������ ���, �� ����� ��������. � ������� ����� ����������� ������� ��� ������ ������������ ��������, ����� ��� 'q()'. �������� ��� ������ ���:

my $CFG_CFLAGS_SHLIB  = '-fpic -DSHARED_MODULE'; # �������� ����� Makefile.tmpl
my $CFG_LD_SHLIB      = 'gcc';                   # �������� ����� Makefile.tmpl
my $CFG_LDFLAGS_SHLIB = q(-shared);              # �������� ����� Makefile.tmpl

������ �������� ����� ��������� ������ � Red Hat 6.1 � 6.2. ������ apxs, ������������ � Red Hat, �������. ������� ����� ������:

my $CFG_LIBEXECDIR    = 'modules';         # �������� ����� APACI install

���� �����, �������� � ���:

my $CFG_LIBEXECDIR    = '/usr/lib/apache'; # �������� ����� APACI install

�������, ���� �� �����������������/��������������� Apache, �������� make clean � ������� ����� ./configure � ����� make.

12. � �������� make � ������� ������ � microtime � ����� RUSAGE_.

� ���� ���������� ����� make �������� ����������, ���� �� ���������� ��������, ������� �������� �������� ���:
microtime.c: In function `php_if_getrusage':
microtime.c:94: storage size of `usg' isn't known
microtime.c:97: `RUSAGE_SELF' undeclared (first use in this function)
microtime.c:97: (Each undeclared identifier is reported only once
microtime.c:97: for each function it appears in.)
microtime.c:103: `RUSAGE_CHILDREN' undeclared (first use in this function)
make[3]: *** [microtime.lo] Error 1
make[3]: Leaving directory `/home/master/php-4.0.1/ext/standard'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/master/php-4.0.1/ext/standard'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/master/php-4.0.1/ext'
make: *** [all-recursive] Error 1

��� ����� ��������, ��� ���� ������� ��������. ��� ����� ��������� ���� ����� /usr/include, ��������� ����� glibc-devel, ��������������� ����� glibc. � ��� ������ ����� ���������� �� ����. ����� �������������� ��������� ���, �������� ������� ����:
$ cat >test.c <<X
#include <sys/resource.h>
X
$ gcc -E test.c >/dev/null

���� ��� �������� ������, �� ������ �����, ��� ��� ������������ �� ����� include-������.

13. � ���� �������� ��� PHP. ��� � ���� ����� ������ ./configure, ������� �������������� ��� ���������� ��������� ���� ������� ������ PHP?

����������� ���� config.nice � �������� ������ ����� ������� ���������� PHP ���, ���� ��� ����������, ������ ��������� ������:
<?php phpinfo(); ?>
� ������� ����� ������ ����� �������� ������ ./configure, ������� ���� ������������ ��� ���������� ������ ���������� PHP.


����� ���������� �����
���������� ����� ������������� PHP

RigaNet - Internet studio
For Web site issues, contact the Web master.

Rambler's Top100 �������@Mail.ru SpyLOG RigaNet