我只能说你的php.ini不是在/etc/php5/apache2/php.ini这个位置!
在那里呢
phpinfo看看就知道了!
改了记得重起一下php

解决方案 »

  1.   

    phpinfo显示出很多内容。
    php.ini文件在哪?
      

  2.   

    Loaded Configuration File  项的值就是
      

  3.   

    phpinfo(); 出来的结果中查找Loaded Configuration File项就是你需要修改的php.ini
      

  4.   

    ubuntu@ubuntu:~$ php /var/www/a.php | nl | grep Loaded
         8 Loaded Configuration File => /etc/php5/cli/php.ini
       208 libXML Loaded Version => 20708
      

  5.   


    /etc/php5/cli/php.ini,这个文件,对么?
      

  6.   

    find / -name "php.ini" 找到php.ini 修改short_open_tag = on 即可。
      

  7.   


    ubuntu@ubuntu:~$ sudo find / -name php.ini/etc/php5/cli/php.ini
    /etc/php5/apache2/php.ini哪个文件?
      

  8.   

    short_open_tag是个布尔类型。
    short_open_tag= on
    ,其中on,是真还是假? 
      

  9.   

    short_open_tag= on ,要改成什么?
      

  10.   


    ubuntu@ubuntu:~$ sudo find / -name php.ini/etc/php5/cli/php.ini
    /etc/php5/apache2/php.ini哪个文件?
    vi   /etc/php5/apache2/php.ini
      

  11.   


    更改了php.ini文件,要重启php才生效?
    怎么重启啊?
      

  12.   


    更改了php.ini文件,要重启php才生效?
    怎么重启啊?service httpd restart或者/usr/local/apache/bin/apachectl restart 具体以你apache安装目录为准。
      

  13.   


    更改了php.ini文件,要重启php才生效?
    怎么重启啊?service httpd restart或者/usr/local/apache/bin/apachectl restart 具体以你apache安装目录为准。这些命令重启php,还是apache?
      

  14.   


    更改了php.ini文件,要重启php才生效?
    怎么重启啊?service httpd restart或者/usr/local/apache/bin/apachectl restart 具体以你apache安装目录为准。这些命令重启php,还是apache?
    基础问题,重启apache
      

  15.   


    更改了php.ini文件,要重启php才生效?
    怎么重启啊?service httpd restart或者/usr/local/apache/bin/apachectl restart 具体以你apache安装目录为准。这些命令重启php,还是apache?
    基础问题,重启apache
    ubuntu@ubuntu:~$ sudo service httpd restarthttpd: unrecognized service
      

  16.   


    find / -name "apache"
    贴出结果。/usr/local/apache/bin/apachectl restart 具体以你apache安装目录为准。
      

  17.   

    short_open_tag 去掉前面的百分号
    short_open_tag= On 
    php.ini 文件中改成这样就是开启了短标记
      

  18.   

    ; Allow the <? tag.  Otherwise, only <?php and <script> tags are recognized.
    ; NOTE: Using short tags should be avoided when developing applications or
    ; libraries that are meant for redistribution, or deployment on PHP
    ; servers which are not under your control, because short tags may not
    ; be supported on the target server. For portable, redistributable code,
    ; be sure not to use short tags.
    short_open_tag = On我的只有一行啊分号后面的都是注释吧
      

  19.   

    ubuntu@ubuntu:~$ sudo find / -name apache2 | nl
    sudo: 无法解析主机:ubuntu
         1 /etc/cron.daily/apache2
         2 /etc/default/apache2
         3 /etc/init.d/apache2
         4 /etc/logrotate.d/apache2
         5 /etc/php5/apache2
         6 /etc/apache2
         7 /run/apache2
         8 /run/lock/apache2
         9 /usr/lib/apache2
        10 /usr/lib/apache2/mpm-event/apache2
        11 /usr/lib/apache2/mpm-itk/apache2
        12 /usr/lib/apache2/mpm-worker/apache2
        13 /usr/lib/apache2/mpm-prefork/apache2
        14 /usr/sbin/apache2
        15 /usr/share/bug/apache2
        16 /usr/share/doc/apache2
        17 /usr/share/doc/apache2.2-common/examples/apache2
        18 /usr/share/apache2
        19 /var/cache/apache2
        20 /var/lib/update-rc.d/apache2
        21 /var/log/apache2
      

  20.   


    更改了php.ini文件,要重启php才生效?
    怎么重启啊?service httpd restart或者/usr/local/apache/bin/apachectl restart 具体以你apache安装目录为准。哪个文件?
      

  21.   

    ubuntu@ubuntu:~$ ls -l  /etc/apache2 
    总用量 52
    -rw-r--r-- 1 root root  8346  2月  7  2012 apache2.conf
    drwxr-xr-x 2 root root   120 12月 31  2013 conf.d
    -rw-r--r-- 1 root root  1322  2月  7  2012 envvars
    -rw-r--r-- 1 root root     0 12月 31  2013 httpd.conf
    -rw-r--r-- 1 root root 31063  2月  7  2012 magic
    drwxr-xr-x 2 root root  1880 12月 31  2013 mods-available
    drwxr-xr-x 2 root root   600 12月 31  2013 mods-enabled
    -rw-r--r-- 1 root root   750  2月  7  2012 ports.conf
    drwxr-xr-x 2 root root    80 12月 31  2013 sites-available
    drwxr-xr-x 2 root root    60 12月 31  2013 sites-enabled