[PHP-users 24797] リロードすると直るParse errorについて

kazuhiro kondou acidblow_b @ yahoo.co.jp
2005年 3月 6日 (日) 14:09:11 JST


初めまして。紺道と申します。

現在以下のような現象で困っております。
どなたかご教授頂けないでしょうか。

■現象
複数のプログラムで不定期に次のようなエラーが出力される。
Warning: Unexpected character in input: ' in ***.php on line 211
Parse error: parse error, unexpected T_STRING in ***.php on line 1383
Parse error: parse error, unexpected '{' in ***.php on line 32

これらのエラーはブラウザをリロードすると出力されなくなります。
プログラムを何度も見直した事、ブラウザをリロードすると正常に動作する事などから
文法上のミスは無いと考えています。

webで検索してみたところ、こちらのMLの過去ログに
同じような現象の投稿がありました。
http://ns1.php.gr.jp/pipermail/php-users/2004-August/023557.html
こちらを参考にし、次の対策を行ってみましたが改善されませんでした。

■行った対策
php.iniの見直し。
output_buffering  = Off
default_charset  = EUC-JP
mbstring.language = Japanese
mbstring.internal_encoding = EUC-JP
mbstring.http_input  = auto
mbstring.http_output = EUC-JP
mbstring.encoding_translation = On
mbstring.detect_order = auto
mbstring.substitute_character = none

全てのPHPスクリプトの先頭に
//有朋自遠方来
を追記。
※スクリプトはEUC,LFにて統一してあります。

■環境
FreeBSD 4.7
Apache/1.3.33
PHP 4.3.10
  './configure' '--with-apxs=/usr/local/apache/bin/apxs' 
'--with-config-file-path=/usr/local/lib' '--disable-debug' 
'--enable-memory-limit' '--enable-zend-multibyte' '--with-regex=system' 
'--enable-mbstring=all' '--enable-mbregex' '--enable-dio' 
'--enable-calendar' '--enable-versioning' '--with-bz2=shared,/usr' 
'--enable-sockets=shared' '--with-pcre-regex=/usr/local' 
'--with-iconv=shared,/usr/local' '--with-gdbm=shared' 
'--with-db3=shared,/usr/local' '--with-gettext=/usr/local' 
'--with-curl=shared,/usr/local' '--with-openssl=shared,/usr' 
'--with-pgsql=shared,/usr/local' '--with-openssl=/usr' 
'--with-gd=shared' '--enable-gd-native-ttf=shared' 
'--with-freetype-dir=shared,/usr/local' '--with-ttf=shared,/usr/local' 
'--with-xpm-dir=/usr/X11R6' '--with-jpeg-dir=shared,/usr/local' 
'--with-png-dir=shared,/usr/local' '--with-t1lib=shared,/usr/local' 
'--with-zlib=/usr' '--with-zlib-dir=/usr' '--enable-ftp=shared' 
'--with-imap=shared,/usr/local' '--with-mcrypt=shared,/usr/local' 
'--with-mhash=shared,/usr/local' '--with-dom=shared,/usr/local/libxml2' 
'--with-dom-xslt=shared,/usr/local' 
'--with-dom-exslt=shared,/usr/local' '--with-mysql=shared,/usr/local' 
'--enable-exif=yes,shared'

よろしくお願いします。

__________________________________
Let's Celebrate Together!
Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/so2005/



PHP-users メーリングリストの案内