пятница, 25 ноября 2011 г.

Centos переустановка PHP в Linux


Выводы, резюме

У меня "простаивает" Linux на ноутбуке... А проблемы с хотингами будут только расти (у всех в России, поскольку специалистов не ценят..., а предпочитают нанимать программистов "таджиков"- халтурщиков... Надо перенести в этот блог мои бодания с Мастерхост...). XAMPP работает настолько медленно, что уже вроде и не работает... Все попытки разобраться с Windows процессами ни к чему не привели. В то же время появилось изрядное количество идей для стартапов. Словом, Linux все равно надо знать, потому я принял стратегическое решение - настраивать Apache-сервер на ноутбуке и таким образом изучать Linux.
Штудирование книжек создало впечателние некоего пониминия, удалось обновить Centos до 5.7, потом я отважно загрузил PHP-5.3 из какого-то "левого" репозитория (родной репозиторий просто не искал ???), он (php -v) обновился, но тестовая страничка phpinfo() показывала белый лист, а инсталлер Друпал-7 останавливался и просил сверить настройки с требуемыми. Словом, я оказался в положении чайника-торопыги, который сам себе навредил.
Usage: httpd [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name : define a name for use in directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files
Потом я пректатил гуглить и, решив получить систематические знания, перечитал все книжки, которые у меня есть дома. Естественно, в голове образовалась каша. В этом посте я намерен разложить все по полочкам... для этого буду испоьзовать комментарии к этому посту.
Другие посты по теме

29 комментариев:

  1. Сначала проверим, какие apache модули установлены
    # rpm -qa | grep apache
    пусто, пробуем
    # rpm -qa | grep htt
    httpd-2.2.3-53.el5.centos.3
    httpd-manual-2.2.3-53.el5.centos.3
    system-config-httpd-1.3.3.3-1.el5
    Видим, что есть основной модуль, справка, и какой-то system-config... а он влкючает модуль для php другие модули? А как должн быть? Ищем мануал, находим на родном сайте только для версии 5.5 http://www.centos.org/docs/5/html/5.5/Technical_Notes/

    ОтветитьУдалить
  2. Перед тем, как читать, сохраним файлы конфигурации
    Главный файл конфигунации Apache /etc/httpd/conf/httpd.conf здесь

    ОтветитьУдалить
  3. Файлы настроек Apache
    # ls /etc/httpd
    conf conf.d logs modules run
    **************************
    /etc/httpd/conf/httpd.conf - основной файл конфигурации
    **************************
    /etc/httpd/conf.d/ -
    This directory holds Apache 2.0 module-specific configuration files;
    any files in this directory which have the ".conf" extension will be
    processed as Apache configuration files.

    Files are processed in alphabetical order, so if using configuration
    directives which depend on, say, mod_perl being loaded, ensure that
    these are placed in a filename later in the sort order than "perl.conf".
    # ls /etc/httpd/conf.d
    auth_mysql.conf perl.conf phpmyadmin.conf python.conf squid.conf webalizer.conf
    manual.conf php.conf proxy_ajp.conf README ssl.conf welcome.conf
    ***************
    ls /etc/httpd/logs - логи доступа, ошибок и SSL
    access_log access_log.4 error_log.3 ssl_error_log ssl_error_log.4
    access_log.1 error_log error_log.4 ssl_error_log.1 ssl_request_log
    access_log.2 error_log.1 ssl_access_log ssl_error_log.2 ssl_request_log.1
    access_log.3 error_log.2 ssl_access_log.1 ssl_error_log.3
    ***************
    см. продолжение в следующем комменте

    ОтветитьУдалить
  4. Это сообщение было удалено автором.

    ОтветитьУдалить
  5. ls -1 /etc/httpd/run
    acpid.socket
    atd.pid
    audispd_events
    auditd.pid
    autofs.fifo-misc
    autofs.fifo-net
    avahi-daemon
    brcm_iscsiuio.pid
    console
    crond.pid
    cups
    cupsd.pid
    dbus
    dhclient-wlan0.pid
    dovecot
    gdm.pid
    gpm.pid
    haldaemon.pid
    hpiod.pid
    hpiod.port
    hpssd.pid
    hpssd.port
    httpd.pid
    iscsid.pid
    klogd.pid
    lvm
    mdadm
    mdmpd
    messagebus.pid
    mysqld
    named
    netreport
    NetworkManager
    news
    nscd
    ntpd.pid
    pcscd.comm
    pcscd.pid
    pcscd.pub
    pm
    ppp
    restorecond.pid
    rpc.statd.pid
    saslauthd
    sdp
    sendmail.pid
    setrans
    sm-client.pid
    spamassassin
    sshd.pid
    sudo
    syslogd.pid
    utmp
    winbindd
    wpa_supplicant
    xfs.pid
    xinetd.pid

    ОтветитьУдалить
  6. ls -1 /etc/httpd/modules
    libphp5.so
    mod_actions.so
    mod_alias.so
    mod_asis.so
    mod_auth_basic.so
    mod_auth_digest.so
    mod_auth_mysql.so
    mod_authn_alias.so
    mod_authn_anon.so
    mod_authn_dbd.so
    mod_authn_dbm.so
    mod_authn_default.so
    mod_authn_file.so
    mod_authnz_ldap.so
    mod_authz_dbm.so
    mod_authz_default.so
    mod_authz_groupfile.so
    mod_authz_host.so
    mod_authz_owner.so
    mod_authz_user.so
    mod_autoindex.so
    mod_cache.so
    mod_cern_meta.so
    mod_cgid.so
    mod_cgi.so
    mod_dav_fs.so
    mod_dav.so
    mod_dbd.so
    mod_deflate.so
    mod_dir.so
    mod_disk_cache.so
    mod_dumpio.so
    mod_env.so
    mod_expires.so
    mod_ext_filter.so
    mod_file_cache.so
    mod_filter.so
    mod_headers.so
    mod_ident.so
    mod_imagemap.so
    mod_include.so
    mod_info.so
    mod_ldap.so
    mod_log_config.so
    mod_log_forensic.so
    mod_logio.so
    mod_mem_cache.so
    mod_mime_magic.so
    mod_mime.so
    mod_negotiation.so
    mod_perl.so
    mod_proxy_ajp.so
    mod_proxy_balancer.so
    mod_proxy_connect.so
    mod_proxy_ftp.so
    mod_proxy_http.so
    mod_proxy.so
    mod_python.so
    mod_reqtimeout.so
    mod_rewrite.so
    mod_setenvif.so
    mod_speling.so
    mod_ssl.so
    mod_status.so
    mod_substitute.so
    mod_suexec.so
    mod_unique_id.so
    mod_userdir.so
    mod_usertrack.so
    mod_version.so
    mod_vhost_alias.so

    ОтветитьУдалить
  7. /etc/logrotate.d/httpd -файл ротации журналов

    cat /etc/logrotate.d/httpd
    /var/log/httpd/*log {
    missingok
    notifempty
    sharedscripts
    postrotate
    /sbin/service httpd reload > /dev/null 2>/dev/null || true
    endscript
    }

    ОтветитьУдалить
  8. cat /etc/sysconfig/httpd
    # Configuration file for the httpd service.

    #
    # The default processing model (MPM) is the process-based
    # 'prefork' model. A thread-based model, 'worker', is also
    # available, but does not work with some modules (such as PHP).
    # The service must be stopped before changing this variable.
    #
    #HTTPD=/usr/sbin/httpd.worker

    #
    # To pass additional options (for instance, -D definitions) to the
    # httpd binary at startup, set OPTIONS here.
    #
    #OPTIONS=

    #
    # By default, the httpd process is started in the C locale; to
    # change the locale in which the server runs, the HTTPD_LANG
    # variable can be set.
    #
    #HTTPD_LANG=C

    ОтветитьУдалить
  9. О конфигурации PHP из файла /usr/share/doc/httpd-2.2.3/migration.html
    *********************************************************************
    The configuration for PHP has been moved from httpd.conf into the file /etc/httpd/conf.d/php.conf. For this file to be loaded, and hence for PHP to work, you must have the statement Include conf.d/*.conf in your httpd.conf as described in Section 2.1.3, “Dynamic Shared Object (DSO) Support”.
    In PHP 4.2.0 and later the default set of predefined variables which are available in the global scope has changed. Individual input and server variables are by default no longer placed directly into the global scope; rather, they are placed into a number superglobal arrays. This change may cause scripts to break, and you may revert to the old behaviour globally by setting register_globals to On in the file /etc/php.ini or more selectivly by using php_value register_globals 1 in your httpd.conf or in .htaccess files.
    As of the php-4.3.6-5 package, the default /etc/php.ini has also changed: it is now based on the php.ini-recommended defaults included in PHP releases, rather than the php.ini-dist defaults as used previously. Notable differences are that:
    display_errors is now Off
    log_errors now On
    magic_quotes_gpc is now Off
    See also:
    PHP 4.1.0 Release Announcement for details of the global scope changes

    ОтветитьУдалить
  10. Документация моей версии Apache в моем компьютере с полным описанием (модулей)
    /var/www/manual/sitemap.html
    /var/www/manual/index.html - главная страница
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Документации по установке PHP на wiki сайте Apache http://wiki.apache.org/httpd/PHP еще нет, но есть ссылки
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    http://wiki.apache.org/httpd/PHPOnWindows http://www.php.net/manual/en/install.windows.apache2.php - для установки под Windows
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    http://www.php.net/manual/en/install.unix.apache2.php -Apache 2.x - on Unix systems
    This section contains notes and hints specific to Apache 2.x installs of PHP on Unix systems.
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    ОтветитьУдалить
  11. Файлы конфигурации PHP
    **********************
    # php --ini
    Configuration File (php.ini) Path: /etc
    Loaded Configuration File: /etc/php.ini
    Scan for additional .ini files in: /etc/php.d
    Additional .ini files parsed: /etc/php.d/curl.ini,
    /etc/php.d/fileinfo.ini,
    /etc/php.d/gd.ini,
    /etc/php.d/imap.ini,
    /etc/php.d/json.ini,
    /etc/php.d/ldap.ini,
    /etc/php.d/mbstring.ini,
    /etc/php.d/mcrypt.ini,
    /etc/php.d/mysql.ini,
    /etc/php.d/mysqli.ini,
    /etc/php.d/pdo.ini,
    /etc/php.d/pdo_mysql.ini,
    /etc/php.d/pdo_sqlite.ini,
    /etc/php.d/phar.ini,
    /etc/php.d/zip.ini

    ОтветитьУдалить
  12. Команда редактора
    # php -h
    Usage: php [options] [-f] <file> [--] [args...]
    php [options] -r <code> [--] [args...]
    php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
    php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
    php [options] -- [args...]
    php [options] -a

    -a Run as interactive shell
    -c <path>|<file> Look for php.ini file in this directory
    -n No php.ini file will be used
    -d foo[=bar] Define INI entry foo with value 'bar'
    -e Generate extended information for debugger/profiler
    -f <file> Parse and execute <file>.
    -h This help
    -i PHP information
    -l Syntax check only (lint)
    -m Show compiled in modules
    -r <code> Run PHP <code> without using script tags <?..?>
    -B <begin_code> Run PHP <begin_code> before processing input lines
    -R <code> Run PHP <code> for every input line
    -F <file> Parse and execute <file> for every input line
    -E <end_code> Run PHP <end_code> after processing all input lines
    -H Hide any passed arguments from external tools.
    -s Output HTML syntax highlighted source.
    -v Version number
    -w Output source with stripped comments and whitespace.
    -z <file> Load Zend extension <file>.

    args... Arguments passed to script. Use -- args when first argument
    starts with - or script is read from stdin

    --ini Show configuration file names

    --rf <name> Show information about function <name>.
    --rc <name> Show information about class <name>.
    --re <name> Show information about extension <name>.
    --ri <name> Show configuration for extension <name>.

    ОтветитьУдалить
  13. Содержание файла, который запускается # service httpd -...
    Находится в папке скриптов /etc/init.d/httpd
    #!/bin/bash
    #
    # httpd Startup script for the Apache HTTP Server
    #
    # chkconfig: - 85 15
    # description: Apache is a World Wide Web server. It is used to serve \
    # HTML files and CGI.
    # processname: httpd
    # config: /etc/httpd/conf/httpd.conf
    # config: /etc/sysconfig/httpd
    # pidfile: /var/run/httpd.pid

    # Source function library.
    . /etc/rc.d/init.d/functions

    if [ -f /etc/sysconfig/httpd ]; then
    . /etc/sysconfig/httpd
    fi

    # Start httpd in the C locale by default.
    HTTPD_LANG=${HTTPD_LANG-"C"}

    # This will prevent initlog from swallowing up a pass-phrase prompt if
    # mod_ssl needs a pass-phrase from the user.
    INITLOG_ARGS=""

    # Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server
    # with the thread-based "worker" MPM; BE WARNED that some modules may not
    # work correctly with a thread-based MPM; notably PHP will refuse to start.

    # Path to the apachectl script, server binary, and short-form for messages.
    apachectl=/usr/sbin/apachectl
    httpd=${HTTPD-/usr/sbin/httpd}
    prog=httpd
    pidfile=${PIDFILE-/var/run/httpd.pid}
    lockfile=${LOCKFILE-/var/lock/subsys/httpd}
    RETVAL=0
    STOP_TIMEOUT=${STOP_TIMEOUT-10}

    # check for 1.3 configuration
    check13 () {
    CONFFILE=/etc/httpd/conf/httpd.conf
    GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
    GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
    GONE="${GONE}AccessConfig|ResourceConfig)"
    if LANG=C grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then
    echo
    echo 1>&2 " Apache 1.3 configuration directives found"
    echo 1>&2 " please read /usr/share/doc/httpd-2.2.3/migration.html"
    failure "Apache 1.3 config directives test"
    echo
    exit 1
    fi
    }

    # The semantics of these two functions differ from the way apachectl does
    # things -- attempting to start while running is a failure, and shutdown
    # when not running is also a failure. So we just do it the way init scripts
    # are expected to behave here.
    start() {
    echo -n $"Starting $prog: "
    check13 || exit 1
    LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
    RETVAL=$?
    echo
    [ $RETVAL = 0 ] && touch ${lockfile}
    return $RETVAL
    }

    # When stopping httpd a delay (of default 10 second) is required
    # before SIGKILLing the httpd parent; this gives enough time for the
    # httpd parent to SIGKILL any errant children.
    stop() {
    echo -n $"Stopping $prog: "
    killproc -p ${pidfile} -d ${STOP_TIMEOUT} $httpd
    RETVAL=$?
    echo
    [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
    }
    reload() {
    echo -n $"Reloading $prog: "
    if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then
    RETVAL=$?
    echo $"not reloading due to configuration syntax error"
    failure $"not reloading $httpd due to configuration syntax error"
    else
    killproc -p ${pidfile} $httpd -HUP
    RETVAL=$?
    fi
    echo
    }

    # See how we were called.
    case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    status)
    status -p ${pidfile} $httpd
    RETVAL=$?
    ;;
    restart)
    stop
    start
    ;;
    condrestart)
    if [ -f ${pidfile} ] ; then
    stop
    start
    fi
    ;;
    reload)
    reload
    ;;
    graceful|help|configtest|fullstatus)
    $apachectl $@
    RETVAL=$?
    ;;
    *)
    echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
    exit 1
    esac

    exit $RETVAL

    ОтветитьУдалить
  14. Параметры моей версии Apache
    # httpd -V
    Server version: Apache/2.2.3
    Server built: Oct 20 2011 17:00:12
    Server's Module Magic Number: 20051115:3
    Server loaded: APR 1.2.7, APR-Util 1.2.7
    Compiled using: APR 1.2.7, APR-Util 1.2.7
    Architecture: 64-bit
    Server MPM: Prefork
    threaded: no
    forked: yes (variable process count)
    Server compiled with....
    -D APACHE_MPM_DIR="server/mpm/prefork"
    -D APR_HAS_SENDFILE
    -D APR_HAS_MMAP
    -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
    -D APR_USE_SYSVSEM_SERIALIZE
    -D APR_USE_PTHREAD_SERIALIZE
    -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
    -D APR_HAS_OTHER_CHILD
    -D AP_HAVE_RELIABLE_PIPED_LOGS
    -D DYNAMIC_MODULE_LIMIT=128
    -D HTTPD_ROOT="/etc/httpd"
    -D SUEXEC_BIN="/usr/sbin/suexec"
    -D DEFAULT_PIDLOG="run/httpd.pid"
    -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
    -D DEFAULT_LOCKFILE="logs/accept.lock"
    -D DEFAULT_ERRORLOG="logs/error_log"
    -D AP_TYPES_CONFIG_FILE="conf/mime.types"
    -D SERVER_CONFIG_FILE="conf/httpd.conf"
    [root@localhost ~]# httpd --help
    (98)Address already in use: make_sock: could not bind to address [::]:80
    (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs

    ОтветитьУдалить
  15. # man httpd
    SYNOPSIS
    httpd [ -d serverroot ] [ -f config ] [ -C directive ] [ -c directive ]
    [ -D parameter ] [ -e level ] [ -E file ] [ -k start|restart|grace-
    ful|stop|graceful-stop ] [ -R directory ] [ -h ] [ -l ] [ -L ] [ -S ] [
    -t ] [ -v ] [ -V ] [ -X ] [ -M ]

    On Windows systems, the following additional arguments are available:

    httpd [ -k install|config|uninstall ] [ -n name ] [ -w ]

    SUMMARY
    httpd is the Apache HyperText Transfer Protocol (HTTP) server program.
    It is designed to be run as a standalone daemon process. When used like
    this it will create a pool of child processes or threads to handle
    requests.

    In general, httpd should not be invoked directly, but rather should be
    invoked via apachectl on Unix-based systems or as a service on Windows
    NT, 2000 and XP and as a console application on Windows 9x and ME.

    OPTIONS
    -d serverroot
    Set the initial value for the ServerRoot directive to server-
    root. This can be overridden by the ServerRoot directive in the
    configuration file. The default is /etc/httpd.

    -f config
    Uses the directives in the file config on startup. If config
    does not begin with a /, then it is taken to be a path relative
    to the ServerRoot. The default is conf/httpd.conf.

    -k start|restart|graceful|stop|graceful-stop
    Signals httpd to start, restart, or stop. See Stopping Apache
    for more information.

    ОтветитьУдалить
  16. Продолжение:
    -k start|restart|graceful|stop|graceful-stop
    Signals httpd to start, restart, or stop. See Stopping Apache for more informa-
    tion.

    -C directive
    Process the configuration directive before reading config files.

    -c directive
    Process the configuration directive after reading config files.

    -D parameter
    Sets a configuration parameter which can be used with sections in
    the configuration files to conditionally skip or process commands at server
    startup and restart.

    -e level
    Sets the LogLevel to level during server startup. This is useful for temporar-
    ily increasing the verbosity of the error messages to find problems during
    startup.

    -E file
    Send error messages during server startup to file.

    -R directory
    When the server is compiled using the SHARED_CORE rule, this specifies the
    directory for the shared object files.

    -h Output a short summary of available command line options.

    -l Output a list of modules compiled into the server. This will not list dynami-
    cally loaded modules included using the LoadModule directive.

    -L Output a list of directives together with expected arguments and places where
    the directive is valid.

    -M Dump a list of loaded Static and Shared Modules.

    -S Show the settings as parsed from the config file (currently only shows the vir-
    tualhost settings).
    -t Run syntax tests for configuration files only. The program immediately exits
    after these syntax parsing tests with either a return code of 0 (Syntax OK) or
    return code not equal to 0 (Syntax Error). If -D DUMP_VHOSTS is also set,
    details of the virtual host configuration will be printed. If -D DUMP_MODULES
    is set, all loaded modules will be printed.

    -v Print the version of httpd, and then exit.

    -V Print the version and build parameters of httpd, and then exit.

    -X Run httpd in debug mode. Only one worker will be started and the server will
    not detach from the console.

    The following arguments are available only on the Windows platform:

    -k install|config|uninstall
    Install Apache as a Windows NT service; change startup options for the Apache
    service; and uninstall the Apache service.

    -n name
    The name of the Apache service to signal.

    -w Keep the console window open on error so that the error message can be read.

    Apache HTTP Server 2005-09-20 HTTPD(8)

    ОтветитьУдалить
  17. Все установленные модули
    # httpd -t -D DUMP_MODULES
    Loaded Modules:
    core_module (static)
    mpm_prefork_module (static)
    http_module (static)
    so_module (static)
    auth_basic_module (shared)
    auth_digest_module (shared)
    authn_file_module (shared)
    authn_alias_module (shared)
    authn_anon_module (shared)
    authn_dbm_module (shared)
    authn_default_module (shared)
    authz_host_module (shared)
    authz_user_module (shared)
    authz_owner_module (shared)
    authz_groupfile_module (shared)
    authz_dbm_module (shared)
    authz_default_module (shared)
    ldap_module (shared)
    authnz_ldap_module (shared)
    include_module (shared)
    log_config_module (shared)
    logio_module (shared)
    env_module (shared)
    ext_filter_module (shared)
    mime_magic_module (shared)
    expires_module (shared)
    deflate_module (shared)
    headers_module (shared)
    usertrack_module (shared)
    setenvif_module (shared)
    mime_module (shared)
    dav_module (shared)
    status_module (shared)
    autoindex_module (shared)
    info_module (shared)
    dav_fs_module (shared)
    vhost_alias_module (shared)
    negotiation_module (shared)
    dir_module (shared)
    actions_module (shared)
    speling_module (shared)
    userdir_module (shared)
    alias_module (shared)
    rewrite_module (shared)
    proxy_module (shared)
    proxy_balancer_module (shared)
    proxy_ftp_module (shared)
    proxy_http_module (shared)
    proxy_connect_module (shared)
    cache_module (shared)
    suexec_module (shared)
    disk_cache_module (shared)
    file_cache_module (shared)
    mem_cache_module (shared)
    cgi_module (shared)
    version_module (shared)
    mysql_auth_module (shared)
    perl_module (shared)
    php5_module (shared)
    proxy_ajp_module (shared)
    python_module (shared)
    ssl_module (shared)
    Syntax OK

    ОтветитьУдалить
  18. Поправка. Список в предыдущем комментарии - это не установленые модули, а (-t -D DUMP_MODULES : show all loaded modules) загруженные при установке.
    А вот внизу список установленых, если судить по наличию mod_so, то надо полагать, что все загруженые модули можно подключать, как Shared Object c поддержкой DSO.
    # httpd -l
    Compiled in modules:
    core.c
    prefork.c
    http_core.c
    mod_so.c

    ОтветитьУдалить
  19. Командой # httpd -L можно распечатать список всех имеющихся конфигурационных директив...
    LoadModule (mod_so.c)
    a module name and the name of a shared object file to load it from
    Allowed in *.conf only outside , or
    LoadFile (mod_so.c)
    shared object file or library to load into the server at runtime
    Allowed in *.conf only outside , or

    ОтветитьУдалить
  20. Директория /etc/httpd/conf.d/ - содержит дополнительные конфигурационные файлы
    This directory holds Apache 2.0 module-specific configuration files;
    any files in this directory which have the ".conf" extension will be
    processed as Apache configuration files.

    Files are processed in alphabetical order, so if using configuration
    directives which depend on, say, mod_perl being loaded, ensure that
    these are placed in a filename later in the sort order than "perl.conf".
    Содержание файла /etc/httpd/conf.d/php.conf

    #
    # PHP is an HTML-embedded scripting language which attempts to make it
    # easy for developers to write dynamically generated webpages.
    #

    LoadModule php5_module modules/libphp5.so


    LoadModule php5_module modules/libphp5-zts.so


    #
    # Cause the PHP interpreter to handle files with a .php extension.
    #
    AddHandler php5-script .php
    AddType text/html .php

    #
    # Add index.php to the list of files that will be served as directory
    # indexes.

    #
    DirectoryIndex index.php

    #
    # Uncomment the following line to allow PHP to pretty-print .phps
    # files as PHP source code:
    #
    #AddType application/x-httpd-php-source .phps

    ОтветитьУдалить
  21. Как они взаимодействуют с php.ini и другими конфигурационными файлами php?
    Сначала посмотрим, где располагаются эти конфигурационные файлы php (справка php -h
    # php --ini
    Configuration File (php.ini) Path: /etc
    Loaded Configuration File: /etc/php.ini
    Scan for additional .ini files in: /etc/php.d
    Additional .ini files parsed:
    /etc/php.d/curl.ini,
    /etc/php.d/fileinfo.ini,
    /etc/php.d/gd.ini,
    /etc/php.d/imap.ini,
    /etc/php.d/json.ini,
    /etc/php.d/ldap.ini,
    /etc/php.d/mbstring.ini,
    /etc/php.d/mcrypt.ini,
    /etc/php.d/mysql.ini,
    /etc/php.d/mysqli.ini,
    /etc/php.d/pdo.ini,
    /etc/php.d/pdo_mysql.ini,
    /etc/php.d/pdo_sqlite.ini,
    /etc/php.d/phar.ini,
    /etc/php.d/zip.ini

    ОтветитьУдалить
  22. Руководство по установке http://httpd.apache.org/docs/2.2/install.html
    В частности, apxs скрипт, используемый для установки PHP, написан на Perl, необходим интерпретатор... может быть поэтому и не установилась библиотека PHP

    For some of the support scripts like apxs or dbmmanage (which are written in Perl) the Perl 5 interpreter is required (versions 5.003 or newer are sufficient). If you have multiple Perl interpreters (for example, a systemwide install of Perl 4, and your own install of Perl 5), you are advised to use the --with-perl option (see below) to make sure the correct one is used by configure. If no Perl 5 interpreter is found by the configure script, you will not be able to use the affected support scripts. Of course, you will still be able to build and use Apache HTTPd.

    ОтветитьУдалить
  23. В папке модулей самая первая - библиотека libphp5.so
    ls -1 /etc/httpd/modules (полностью содержание распечатано выше)
    Значит, все должно работать нормально.
    пробуем ввести команду # php -i
    и оказывается, что все работает, пробуем тестовый файл с phpinfo(); localhost/test.php и получаем наконец то желаемую страницу.
    Вероятно, я вчера скомпоновал все # make и сам этого не заметил, вернее не понял... или просто обновился? Надо в журнале поискать...

    ОтветитьУдалить
  24. В пхп тоже работают динамические расширения (если апаш настроен, а он настроен). Вот, как о них написано в моем php.ini
    ;;;;;;;;;;;;;;;;;;;;;;
    ; Dynamic Extensions ;
    ;;;;;;;;;;;;;;;;;;;;;;
    ;
    ; If you wish to have an extension loaded automatically, use the following
    ; syntax:
    ;
    ; extension=modulename.extension
    ;
    ; For example:
    ;
    ; extension=msql.so
    ;
    ; Note that it should be the name of the module only; no directory information
    ; needs to go here. Specify the location of the extension with the
    ; extension_dir directive above.


    ;;;;
    ; Note: packaged extension modules are now loaded via the .ini files
    ; found in the directory /etc/php.d; these are loaded by default.
    ;;;;
    Список модулей есть в комментах выше, теперь вопрос, а как мне установить модуль dom, о котором мне написал установщик Drupal

    PHP extensions Disabled
    Drupal requires you to enable the PHP extensions in the following list (see the system requirements page for more information):
    * dom
    Ответ есть в библии пользователя

    Building PHP as a Dynamic Shared Object (DSO) module

    You must have DSO support enabled in Apache before you can use PHP as a DSO
    module. To recompile Apache with DSO support, do the following:
    1. From the Apache source distribution directory run the following command
    as root:
    ./configure --prefix=/usr/local/apache --enable-so
    You can also add other options as necessary.
    2. You can compile and install Apache using make && make install command.
    After you have a DSO support-enabled Apache server, you can do the following to
    create a DSO module for PHP:
    1. From the PHP source distribution directory run the following command as root:
    ./configure --with-apxs2=/usr/local/apache/bin/apxs \
    --with-mysql=/usr
    Here the --with-mysql option is set to /usr because MySQL RPM packages
    install the include files in /usr/include/mysql directory. If your system has
    MySQL includes in a different location, you should use a different directory
    name. You can find out where MySQL includes are kept by using the locate
    mysql.h command, which is available on most Unix systems with the locate
    database feature.
    2. Now run make && make install to compile and install the DSO version of
    PHP module for Apache.
    3. Run the /usr/local/apache/bin/apachectl restart command to restart
    (or start) Apache.

    ОтветитьУдалить
  25. Вот две ссылки на установки откомпилированных модулей, вот только из rfrjuj htgjpbnfhbz мне взять модуль dom
    Установка PHP 5.3.6 Apache (httpd) и MySQL 5.1.56 на CentOS 5.5. http://dedicatesupport.com/content/ustanovka-php-536-apache-httpd-i-mysql-5156-na-centos-55

    http://metalcandy.ru/how-to-forge-centos/281-installing-php-533-on-centos-55

    ОтветитьУдалить
  26. Creating a simple command-line PHP script
    After you have configured PHP, you can run a PHP script from the command-line
    just like you can run a Perl script. By default the PHP interpreter is installed in the
    /usr/local/bin directory on Unix systems; on Windows systems, it is installed in
    the directory where you extracted the distribution. You can create a simple PHP
    script called test.php as shown in Listing 15-1.
    Listing 15-1: test.php
    #!/usr/local/bin/php -q
    # For Windows change the above line to:
    #!Drive:/path/to/php -q
    #
    #
    <?php
    echo “Welcome to the PHP World\n”;
    ?>

    ОтветитьУдалить
  27. Я загрузил PHP отсюда http://www.webtatic.com/packages/php53/ (нашел в менеджере пакетов адрес).
    PHP 5.3 on CentOS/RHEL 5.6
    И вот почему.
    I have compiled the latest PHP version, 5.3.8, and put it in the Webtatic repository for easy installation. It is compiled for CentOS 5 i386 and x86_64, and the source RPMS are provided in the repo, if anyone wants to compile it for another OS or architecture.
    Здесь же, в нижней частит страницы я обнаружил, что модуль DOM - это модуль, который необходим для модуля XML.
    Я просто взял и снова подключился к депозитарию (гаалочка в настройках) и загрузил два модуля XML XMLRPC
    Вот, что получилось:
    php -m
    [PHP Modules]
    bz2
    calendar
    Core
    ctype
    curl
    date
    dom
    ereg
    exif
    fileinfo
    filter
    ftp
    gd
    gettext
    gmp
    hash
    iconv
    imap
    json
    ldap
    libxml
    mbstring
    mcrypt
    mysql
    mysqli
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    readline
    Reflection
    session
    shmop
    SimpleXML
    sockets
    SPL
    standard
    tokenizer
    wddx
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    zip
    zlib

    [Zend Modules]

    ОтветитьУдалить
  28. Теперь снова к установке Drupal, ...перезапускаем скрипт (страница в браузере) ...ничего!
    Перезапускаем
    httpd -k restart
    Теперь все нормально. Как все просто. Надо бы теперь написать о двух способах "сборки" PHP

    ОтветитьУдалить
  29. В качесте опций, здесь записаны start, stop, restart, status, condrestart( перезапуск при наличии var/run/httpd.pid Этот файл создается при запуске сервера и удаляется при его остановке. Если файл не удален, а сервер не остановлен, значит сервер не был остановлен корректно... )

    ОтветитьУдалить