Menu

PHP Parse error: syntax error

Help
PyR2
2014-10-01
2014-10-07
  • PyR2

    PyR2 - 2014-10-01

    Hi, I have the following error when I try to load http://localhost/AVMF/index.php , any idea from where it come :

    [Wed Oct 01 17:41:08.942883 2014] [:error] [pid 7959] [client 127.0.0.1:41582] PHP Parse error: syntax error, unexpected '}' in /var/www/html/AVMF/include/html.inc.php on line 236

    Thank you

     
    • PyR2

      PyR2 - 2014-10-02

      Solution found : turn short_open_tag = On on the php.ini file.

      Should be better for security to use <?php tag instead of <?.

      Perhaps this could be solved for future release ?. Thank

       
  • tiochan

    tiochan - 2014-10-02

    Yep!
    This is one pending task on SIGVI, adapt the code to the latest versions of PHP, where, by default, short tags aren't supported. I have received lot of help on this issue.

    Thanks a lot.

     
    • PyR2

      PyR2 - 2014-10-02

      Hi,

      I begin to test Sigvi, if you are interesting I can send you bugs found ?

      Thank you for your work.

      I performed the following changes to make SIGVI work on my configuration (see at the end of the file for details) :

      --> For the short tag problem i perform the following command on all php file :
      for f in find ./ -name "*.php" ; do sed 's:<?=:<?php echo:g' $f | sed 's:<?:<?php:g' | sed 's:<?phpphp:<?php:g' > $f.tmp && mv $f.tmp $f ; done

      --> other problems

      in mysql.class.php line 556
      replace final public static function dbms_get_current_timestamp_query(&$date) {
      by final public static function dbms_get_current_timestamp_query() {

      --> For the problem of argument transfered by ref, I performed the following changes (probably others will come on this problem) :

      [PHP EVO] in vulnerabilities.php line 206 change from :
      $dw= new my_vuln("vulnerabilities",$fields, 0, "", "order by publish_date", false, false, false,&$null);
      to :
      $dw= new my_vuln("vulnerabilities",$fields, 0, "", "order by publish_date", false, false, false,$null);

      [PHP EVO] in dw_alerts.class.php line 183 change from :
      $fields[1]= new field_ext("alerts.id_server",$MESSAGES["ALERT_SERVER_FIELD_NAME"],"foreign_key",true,false,0,false,&$null_reference,$server_reference);
      to :
      $fields[1]= new field_ext("alerts.id_server",$MESSAGES["ALERT_SERVER_FIELD_NAME"],"foreign_key",true,false,0,false,$null_reference,$server_reference);

      [PHP EVO] in dw_alerts.class.php line 192 change from :
      xml_set_object($this->xml_parser, &$this);
      to
      xml_set_object($this->xml_parser, $this);

      [PHP EVO] in xml_reader.php line 71 change from :
      xml_set_object($this->xml_parser, &$this);
      to :
      xml_set_object($this->xml_parser, $this);

      Configuration : Xubuntu 14.04

      pmo@pmo-samsung-M3:~$ dpkg -l | grep php
      ii libapache2-mod-php5 5.5.9+dfsg-1ubuntu4.4 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
      ii php5-cli 5.5.9+dfsg-1ubuntu4.4 amd64 command-line interpreter for the php5 scripting language
      ii php5-common 5.5.9+dfsg-1ubuntu4.4 amd64 Common files for packages built from the php5 source
      ii php5-gd 5.5.9+dfsg-1ubuntu4.4 amd64 GD module for php5
      ii php5-json 1.3.2-2build1 amd64 JSON module for php5
      ii php5-mysql 5.5.9+dfsg-1ubuntu4.4 amd64 MySQL module for php5
      ii php5-readline 5.5.9+dfsg-1ubuntu4.4 amd64 Readline module for php5

      pmo@pmo-samsung-M3:~$ dpkg -l | grep apache
      ii apache2 2.4.7-1ubuntu4.1 amd64 Apache HTTP Server
      ii apache2-bin 2.4.7-1ubuntu4.1 amd64 Apache HTTP Server (binary files and modules)
      ii apache2-data 2.4.7-1ubuntu4.1 all Apache HTTP Server (common files)
      ii libapache2-mod-php5 5.5.9+dfsg-1ubuntu4.4 amd64 server-side, HTML-embedded scripting language (Apache 2 module)

      pmo@pmo-samsung-M3:~$ dpkg -l | grep mysql
      ii libdbd-mysql-perl 4.025-1 amd64 Perl5 database interface to the MySQL database
      ii libmysqlclient18:amd64 5.5.38-0ubuntu0.14.04.1 amd64 MySQL database client library
      ii mysql-client-5.5 5.5.38-0ubuntu0.14.04.1 amd64 MySQL database client binaries
      ii mysql-client-core-5.5 5.5.38-0ubuntu0.14.04.1 amd64 MySQL database core client binaries
      ii mysql-common 5.5.38-0ubuntu0.14.04.1 all MySQL database common files, e.g. /etc/mysql/my.cnf
      ii mysql-server 5.5.38-0ubuntu0.14.04.1 all MySQL database server (metapackage depending on the latest version)
      ii mysql-server-5.5 5.5.38-0ubuntu0.14.04.1 amd64 MySQL database server binaries and system database setup
      ii mysql-server-core-5.5 5.5.38-0ubuntu0.14.04.1 amd64 MySQL database server binaries
      ii php5-mysql 5.5.9+dfsg-1ubuntu4.4 amd64 MySQL module for php5
      ii python-mysqldb 1.2.3-2ubuntu1 amd64 Python interface to MySQL

      ----- Mail original -----
      De: "tiochan" tiochan@users.sf.net
      À: "[sigvi:discussion]" 519015@discussion.sigvi.p.re.sf.net
      Envoyé: Jeudi 2 Octobre 2014 21:25:53
      Objet: [sigvi:discussion] PHP Parse error: syntax error

      Yep!
      This is one pending task on SIGVI, adapt the code to the latest versions of PHP, where, by default, short tags aren't supported. I have received lot of help on this issue.

      Thanks a lot.

      PHP Parse error: syntax error

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/sigvi/discussion/519015/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • tiochan

    tiochan - 2014-10-07

    Great work.
    I saved it to apply for the next release.

    Thanks a lot.

     

Log in to post a comment.