Levin
Новичок
Re: Проблема с auto_prepend_file и auto_append_file
настройки виртхоста:
<VirtualHost *:8080>
<Directory "H:\\home\\hp\\public_html">
Options Includes FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all
</Directory>
ServerAdmin webmaster@localhost
DocumentRoot "H:\\home\\hp\\public_html"
ServerName hp
ErrorLog "logs/hp_error_log"
CustomLog "logs/hp_access_log" common
RewriteEngine On
RewriteLogLevel 1
RewriteLog "logs/hp_rewrite_log"
php_value error_log "logs/hp_php_errors"
</VirtualHost>
.htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /index.html?url=$1 [L]
AddHandler application/x-httpd-php html
AddType application/x-httpd-php html
Options FollowSymLinks Includes
#CharsetSourceEnc windows-1251
ErrorDocument 404 /index.html
ErrorDocument 403 /index.html
php_value max_execution_time 30
php_value output_buffering off
php_flag magic_quotes_gpc Off
php_flag display_errors On
php_flag register_globals On
php_value session.use_trans_sid 0
php_value session.name SESSID
php_value auto_prepend_file "H:/home/hp/public_html/a.php"
php_value auto_append_file "H:/home/hp/public_html/p.php"
---------
a.php, p.php:
<?="<hr/>";?>
index.html:
HI!
<?="PHP TEST!";?>
выводит в браузере:
<?
echo "<hr/>";
?>HI!
<?
echo "PHP TEST!";
?><?
echo "<hr/>";
?>
при этом если указать
RewriteRule ^(.*)\.html$ /index.php?url=$1 [L]
то выводит:
<?
echo "<hr/>";
?>HI!
PHP TEST!<?
echo "<hr/>";
?>
т.е. index.php обрабатывает а препенд и аппенд - нет
понять не могу где собака порылась? причем раньше все работало (Apache 1.3 + PHP 4.3)
Сейчас стоит: Apache 2.2 + PHP 5.2
Искал на форумах, ответа не нашел.
У меня похожая проблема, но я скажу больше: белый экран, потому как не обрабатывается php scriptАвтор оригинала: cfif
Кладу в папку C:\Program Files\Apache Group\Apache\htdocs файлы autoprep.php и autoapp.php, прописываю в php.ini (тот что в c:\windows ):
auto_prepend_file ="C:\Program Files\Apache Group\Apache\htdocs\autoprep.php"
auto_append_file ="C:\Program Files\Apache Group\Apache\htdocs\autoapp.php"
и при запуске php-шных файлов в браузере - белый экран.
Как заставить подгружать autoprep.php и autoapp.php?
настройки виртхоста:
<VirtualHost *:8080>
<Directory "H:\\home\\hp\\public_html">
Options Includes FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all
</Directory>
ServerAdmin webmaster@localhost
DocumentRoot "H:\\home\\hp\\public_html"
ServerName hp
ErrorLog "logs/hp_error_log"
CustomLog "logs/hp_access_log" common
RewriteEngine On
RewriteLogLevel 1
RewriteLog "logs/hp_rewrite_log"
php_value error_log "logs/hp_php_errors"
</VirtualHost>
.htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /index.html?url=$1 [L]
AddHandler application/x-httpd-php html
AddType application/x-httpd-php html
Options FollowSymLinks Includes
#CharsetSourceEnc windows-1251
ErrorDocument 404 /index.html
ErrorDocument 403 /index.html
php_value max_execution_time 30
php_value output_buffering off
php_flag magic_quotes_gpc Off
php_flag display_errors On
php_flag register_globals On
php_value session.use_trans_sid 0
php_value session.name SESSID
php_value auto_prepend_file "H:/home/hp/public_html/a.php"
php_value auto_append_file "H:/home/hp/public_html/p.php"
---------
a.php, p.php:
<?="<hr/>";?>
index.html:
HI!
<?="PHP TEST!";?>
выводит в браузере:
<?
echo "<hr/>";
?>HI!
<?
echo "PHP TEST!";
?><?
echo "<hr/>";
?>
при этом если указать
RewriteRule ^(.*)\.html$ /index.php?url=$1 [L]
то выводит:
<?
echo "<hr/>";
?>HI!
PHP TEST!<?
echo "<hr/>";
?>
т.е. index.php обрабатывает а препенд и аппенд - нет
понять не могу где собака порылась? причем раньше все работало (Apache 1.3 + PHP 4.3)
Сейчас стоит: Apache 2.2 + PHP 5.2
Искал на форумах, ответа не нашел.