Добрый день стои ОС Windows xp , установил Apache 2.2.10 и установил PHP 5.2.6 с инсталятора Apache работает но вот php-код им не обрабатываетса, так понимаю что нужна какая-то привязка, что б apache отправлял php-код обработчику? так как ету привязку зделать? при установке PHP спрашивал место конфигов Apache и автоматично добавил в httpd.conf PHPIniDir "C:/Program Files/PHP/" LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll" AddType application/x-httpd-php .php AddType application/x-httpd-php phtml php
1. рестарт Апач 2. создать в DocumentRoot файл main.php 3. в нем написать PHP: <?php phpinfo() ?> 4. в браузере написать localhost/main.php 5. тут написать, что выводится в окне браузера
если просто то пишет It work's [Wed Jan 01 08:52:04 2003] [error] [client 127.0.0.1] script 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/main.php' not found or unable to stat [Wed Jan 01 09:04:44 2003] [error] [client 127.0.0.1] script 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/main.php' not found or unable to stat [Wed Jan 01 09:04:50 2003] [error] [client 127.0.0.1] script 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/main.php' not found or unable to stat [Wed Jan 01 09:04:51 2003] [error] [client 127.0.0.1] script 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/main.php' not found or unable to stat
после рестарта [Wed Jan 01 08:51:42 2003] [notice] Parent: Received restart signal -- Restarting the server. [Wed Jan 01 08:51:42 2003] [notice] Child 2352: Exit event signaled. Child process is ending. httpd.exe: Could not reliably determine the server's fully qualified domain name, using 10.1.150.112 for ServerName [Wed Jan 01 08:51:43 2003] [notice] Apache/2.2.10 (Win32) PHP/5.2.6 configured -- resuming normal operations [Wed Jan 01 08:51:43 2003] [notice] Server built: Oct 10 2008 12:39:04
мне кажется, не работает пхп-модуль, можно попробовать запустить файл из командной строки при помощи php.exe и посмотреть что пишет если работает, то можно: 1. переустановить пхп 2. попробовать установить пхп as cgi
установил как cgi и также ! никаких изменений на линуксе вообще без проблем было может показать конфиг?
date.default_latitude => 31.7667 => 31.7667 date.default_longitude => 35.2333 => 35.2333 date.sunrise_zenith => 90.583333 => 90.583333 date.sunset_zenith => 90.583333 => 90.583333 date.timezone => no value => no value dom DOM/XML => enabled DOM/XML API Version => 20031129 libxml Version => 2.6.32 HTML Support => enabled XPath Support => enabled XPointer Support => enabled Schema Support => enabled RelaxNG Support => enabled filter Input Validation and Filtering => enabled Revision => $Revision: 1.52.2.42 $ Directive => Local Value => Master Value filter.default => unsafe_raw => unsafe_raw filter.default_flags => no value => no value ftp FTP support => enabled hash hash support => enabled Hashing Engines => md2 md4 md5 sha1 sha256 sha384 sha512 ripemd128 ripemd160 rip emd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160, 4 tiger192,4 snefru gost adler32 crc32 crc32b haval128,3 haval160,3 haval192,3 h aval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 hava l128,5 haval160,5 haval192,5 haval224,5 haval256,5 iconv iconv support => enabled iconv implementation => "libiconv" iconv library version => 1.11 Directive => Local Value => Master Value iconv.input_encoding => ISO-8859-1 => ISO-8859-1 iconv.internal_encoding => ISO-8859-1 => ISO-8859-1 iconv.output_encoding => ISO-8859-1 => ISO-8859-1 json json support => enabled json version => 1.2.1 libxml libXML support => active libXML Version => 2.6.32 libXML streams => enabled odbc ODBC Support => enabled Active Persistent Links => 0 Active Links => 0 ODBC library => Win32 Directive => Local Value => Master Value odbc.allow_persistent => On => On odbc.check_persistent => On => On odbc.default_db => no value => no value odbc.default_pw => no value => no value odbc.default_user => no value => no value odbc.defaultbinmode => return as is => return as is odbc.defaultlrl => return up to 4096 bytes => return up to 4096 bytes odbc.max_links => Unlimited => Unlimited odbc.max_persistent => Unlimited => Unlimited pcre PCRE (Perl Compatible Regular Expressions) Support => enabled PCRE Library Version => 7.6 2008-01-28 Directive => Local Value => Master Value pcre.backtrack_limit => 100000 => 100000 pcre.recursion_limit => 100000 => 100000 Reflection Reflection => enabled Version => $Id: php_reflection.c,v 1.164.2.33.2.50 2008/03/13 15:56:21 iliaa Exp $ session Session Support => enabled Registered save handlers => files user Registered serializer handlers => php php_binary wddx Directive => Local Value => Master Value session.auto_start => Off => Off session.bug_compat_42 => Off => Off session.bug_compat_warn => On => On session.cache_expire => 180 => 180 session.cache_limiter => nocache => nocache session.cookie_domain => no value => no value session.cookie_httponly => Off => Off session.cookie_lifetime => 0 => 0 session.cookie_path => / => / session.cookie_secure => Off => Off session.entropy_file => no value => no value session.entropy_length => 0 => 0 session.gc_divisor => 1000 => 1000 session.gc_maxlifetime => 1440 => 1440 session.gc_probability => 1 => 1 session.hash_bits_per_character => 5 => 5 session.hash_function => 0 => 0 session.name => PHPSESSID => PHPSESSID session.referer_check => no value => no value session.save_handler => files => files session.save_path => C:\WINDOWS\Temp => C:\WINDOWS\Temp session.serialize_handler => php => php session.use_cookies => On => On session.use_only_cookies => Off => Off session.use_trans_sid => 0 => 0 SimpleXML Simplexml support => enabled Revision => $Revision: 1.151.2.22.2.39 $ Schema support => enabled SPL SPL support => enabled Interfaces => Countable, OuterIterator, RecursiveIterator, SeekableIterator, Spl Observer, SplSubject Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, Em ptyIterator, FilterIterator, InfiniteIterator, InvalidArgumentException, Iterato rIterator, LengthException, LimitIterator, LogicException, NoRewindIterator, Out OfBoundsException, OutOfRangeException, OverflowException, ParentIterator, Range Exception, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryI terator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexItera tor, RegexIterator, RuntimeException, SimpleXMLIterator, SplFileInfo, SplFileObj ect, SplObjectStorage, SplTempFileObject, UnderflowException, UnexpectedValueExc eption standard Regex Library => Bundled library enabled Dynamic Library Support => enabled Internal Sendmail Support for Windows => enabled Directive => Local Value => Master Value assert.active => 1 => 1 assert.bail => 0 => 0 assert.callback => no value => no value assert.quiet_eval => 0 => 0 assert.warning => 1 => 1 auto_detect_line_endings => 0 => 0 default_socket_timeout => 60 => 60 safe_mode_allowed_env_vars => PHP_ => PHP_ safe_mode_protected_env_vars => LD_LIBRARY_PATH => LD_LIBRARY_PATH url_rewriter.tags => a=href,area=href,frame=src,input=src,form=fakeentry => a=hr ef,area=href,frame=src,input=src,form=fakeentry user_agent => no value => no value tokenizer Tokenizer Support => enabled wddx WDDX Support => enabled WDDX Session Serializer => enabled xml XML Support => active XML Namespace Support => active libxml2 Version => 2.6.32 xmlreader XMLReader => enabled xmlwriter XMLWriter => enabled zlib ZLib Support => enabled Stream Wrapper support => compress.zlib:// Stream Filter support => zlib.inflate, zlib.deflate Compiled Version => 1.2.3 Linked Version => 1.2.3 Directive => Local Value => Master Value zlib.output_compression => Off => Off zlib.output_compression_level => -1 => -1 zlib.output_handler => no value => no value Additional Modules Module Name Environment Variable => Value ALLUSERSPROFILE => C:\Documents and Settings\All Users APPDATA => C:\Documents and Settings\└фьшэшёЄЁрЄюЁ\Application Data CLIENTNAME => Console CommonProgramFiles => C:\Program Files\Common Files COMPUTERNAME => ADMIN ComSpec => C:\WINDOWS\system32\cmd.exe FP_NO_HOST_CHECK => NO HOMEDRIVE => C: HOMEPATH => \Documents and Settings\└фьшэшёЄЁрЄюЁ LOGONSERVER => \\ADMIN NUMBER_OF_PROCESSORS => 1 OS => Windows_NT Path => C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem PATHEXT => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE => x86 PROCESSOR_IDENTIFIER => x86 Family 6 Model 8 Stepping 1, AuthenticAMD PROCESSOR_LEVEL => 6 PROCESSOR_REVISION => 0801 ProgramFiles => C:\Program Files PROMPT => $P$G SESSIONNAME => Console SystemDrive => C: SystemRoot => C:\WINDOWS TEMP => C:\DOCUME~1\└─╠╚═╚~1\LOCALS~1\Temp TMP => C:\DOCUME~1\└─╠╚═╚~1\LOCALS~1\Temp USERDOMAIN => ADMIN USERNAME => └фьшэшёЄЁрЄюЁ USERPROFILE => C:\Documents and Settings\└фьшэшёЄЁрЄюЁ windir => C:\WINDOWS PHP Variables Variable => Value _SERVER["ALLUSERSPROFILE"] => C:\Documents and Settings\All Users _SERVER["APPDATA"] => C:\Documents and Settings\└фьшэшёЄЁрЄюЁ\Application Data _SERVER["CLIENTNAME"] => Console _SERVER["CommonProgramFiles"] => C:\Program Files\Common Files _SERVER["COMPUTERNAME"] => ADMIN _SERVER["ComSpec"] => C:\WINDOWS\system32\cmd.exe _SERVER["FP_NO_HOST_CHECK"] => NO _SERVER["HOMEDRIVE"] => C: _SERVER["HOMEPATH"] => \Documents and Settings\└фьшэшёЄЁрЄюЁ _SERVER["LOGONSERVER"] => \\ADMIN _SERVER["NUMBER_OF_PROCESSORS"] => 1 _SERVER["OS"] => Windows_NT _SERVER["Path"] => C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem _SERVER["PATHEXT"] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH _SERVER["PROCESSOR_ARCHITECTURE"] => x86 _SERVER["PROCESSOR_IDENTIFIER"] => x86 Family 6 Model 8 Stepping 1, AuthenticAMD _SERVER["PROCESSOR_LEVEL"] => 6 _SERVER["PROCESSOR_REVISION"] => 0801 _SERVER["ProgramFiles"] => C:\Program Files _SERVER["PROMPT"] => $P$G _SERVER["SESSIONNAME"] => Console _SERVER["SystemDrive"] => C: _SERVER["SystemRoot"] => C:\WINDOWS _SERVER["TEMP"] => C:\DOCUME~1\└─╠╚═╚~1\LOCALS~1\Temp _SERVER["TMP"] => C:\DOCUME~1\└─╠╚═╚~1\LOCALS~1\Temp _SERVER["USERDOMAIN"] => ADMIN _SERVER["USERNAME"] => └фьшэшёЄЁрЄюЁ _SERVER["USERPROFILE"] => C:\Documents and Settings\└фьшэшёЄЁрЄюЁ _SERVER["windir"] => C:\WINDOWS _SERVER["PHP_SELF"] => _SERVER["SCRIPT_NAME"] => _SERVER["SCRIPT_FILENAME"] => _SERVER["PATH_TRANSLATED"] => _SERVER["DOCUMENT_ROOT"] => _SERVER["REQUEST_TIME"] => 1041448407 _SERVER["argv"] => Array ( ) _SERVER["argc"] => 0 PHP License This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net. C:\Program Files\PHP>
Примерно похожая проблема. Apache работает выдает It works? а вот PHP нет.Что в denwer, что в отдельной настройке. Помогите пожалуйста, сам не могу разобраться.
А что значит, не работает PHP? Как он не работает? Ошибки какие-то? Или просто PHP-код выводится в браузер? Или что ещё?
Никаких ошибок не выводит,просто там где он должен выводить php файл он выводит It work. В форумах ничего вразумительного не нашел. Устанавливал и настраивал .по руководствам с сайтов.