目前最新版本,apache服务器里VirtualHost设置不支持php_admin_flag了吗?

问答中心分类: Linux目前最新版本,apache服务器里VirtualHost设置不支持php_admin_flag了吗?
chenyanyu asked 5 年 ago
<VirtualHost *:88>
ServerAdmin 115094938782@qq.com
DocumentRoot "/data/TC_user_data/tcis_erp/html_tcis_ccb"
ServerName 127.0.0.1
#php_admin_flag register_argc_argv on
#php_admin_flag register_globals on
#php_admin_flag register_long_arrays on
#php_admin_flag short_open_tag on
#php_admin_flag RewriteEngine on
#php_admin_flag magic_quotes_gpc on
#php_admin_value session.cookie_lifetime 0
#php_admin_value session.gc_maxlifetime 10800
#php_admin_value session.save_path /data/ip/

#php_admin_flag display_errors off

CustomLog "/data/wwwlogs/access_apache_ip.log" common

<Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>
Order allow,deny
Deny from all
</Files>
<FilesMatch \.php$>
SetHandler "proxy:unix:/dev/shm/php-cgi.sock|fcgi://localhost"
</FilesMatch>

<Directory "/data/TC_user_data/tcis_erp/html_tcis_ccb">
SetOutputFilter DEFLATE
Options FollowSymLinks ExecCGI
Require all granted
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
</Directory>
<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Location>
</VirtualHost>
//-----------------------------------------------
把php_admin_flag项的注解去掉,httpd 起不动,注解掉就可以了。
现在要设置怎么办呢?
 
 

2 Answers
oneinstack answered 5 年 ago
写在<Directory吧
或者直接写到.htaccess

chenyanyu answered 5 年 ago
写在<Directory>里也起不动httpd提示如下:
[root@TCserver78 ~]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service
Job for httpd.service failed because the control process exited with error code. See \"systemctl status httpd.service\" and \"journalctl -xe\" for details.
//-----------------------------------------------------
apache配置文件0.conf:
<VirtualHost *:88>
  ServerAdmin 1150949878@qq.com
  DocumentRoot \"/data/TC_user_data/tcis_erp/html_tcis_ccb\"
  ServerName 127.0.0.1
  
  CustomLog \"/data/wwwlogs/access_apache_ip.log\" common 
 
  <Files ~ (\\.user.ini|\\.htaccess|\\.git|\\.svn|\\.project|LICENSE|README.md)$>
    Order allow,deny
    Deny from all
  </Files>
  <FilesMatch \\.php$>
    SetHandler \"proxy:unix:/dev/shm/php-cgi.sock|fcgi://localhost\"
  </FilesMatch>
 
<Directory \"/data/TC_user_data/tcis_erp/html_tcis_ccb\">

  #php_admin_flag register_argc_argv on
  #php_admin_flag register_globals on
  #php_admin_flag register_long_arrays on
  #php_admin_flag short_open_tag on     
  #php_admin_flag RewriteEngine on   
  #php_admin_flag magic_quotes_gpc on   
  #php_admin_value session.cookie_lifetime 0
  #php_admin_value session.gc_maxlifetime  10800
  #php_admin_value session.save_path    /data/TC_user_data/tcis_erp/php_path/ccb_save_path/ip/
 
  #php_admin_flag display_errors off
 
  SetOutputFilter DEFLATE
  Options FollowSymLinks ExecCGI
  Require all granted
  AllowOverride All
  Order allow,deny
  Allow from all
  DirectoryIndex index.html index.php
 
</Directory>
<Location /server-status>
  SetHandler server-status
  Order Deny,Allow
  Deny from all
  Allow from 127.0.0.1
</Location>
</VirtualHost>
注释部分打开起不动,注释掉就可以。
另,咨询一下,修改apache哪里可以保持以前VirtualHost的配置文件不变?