Php Xml Syntax Error Unexpected T_string
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack short_open_tag Overflow the company Business Learn more about hiring developers or posting ads with us
Parse Error Syntax Error Unexpected T_string
Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PHP Parse error - unexpected T_STRING [duplicate] up vote 9 down vote favorite 2 This question already has an answer here: Why when add to web page don´t work on hosting? 1 answer In Windows (WAMP) I have an index.php like this and it works as expected. Now I've just configured a LAMP on Ubuntu and the same file (when invoked from a browser) gives me an error. Looking in error.log I've found PHP Parse error: syntax error, unexpected T_STRING in /var/www/test/index.php on line 1 If I remove first line everything works fine. What's wrong? Why this works on Windows and not on Linux? Could this be caused from a particular extension? xml php share|improve this question edited Mar 5 '13 at 11:00 hakre 134k26216390 asked May 8 '12 at 20:33 Marco 36.9k970103 marked as duplicate by Alexander, Ocramius, Gordon, hakre, Jocelyn Mar 5 '13 at 12:17 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. I think the short tags answers will work; in my experience, I've always echoed the string from PHP code so I didn't have to worry about how short tags were set. –Crontab May 8 '12 at 20:45 echo ''; –Hosam alzagh Feb 19 at 14:14 add a comment| 3 Answers 3 active oldest votes up vote 20 down vote accepted It sounds like you have short tags enabled, which will cause PHP to try and parse what comes after . Set the config option short_open_tag in php.ini to 0 or Off and restart Apache. share|improve this answer answered May 8 '12 at 20:36 nickb 44.7k6
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users http://stackoverflow.com/questions/10506057/php-parse-error-unexpected-t-string Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Parse error: syntax error, unexpected T_STRING with index.php? up vote 2 down http://stackoverflow.com/questions/2820375/parse-error-syntax-error-unexpected-t-string-with-index-php vote favorite It works perfectly in local host but when I upload it intothe server it has the following error: Parse error: syntax error, unexpected T_STRING in D:\Hosting\4923367\html\beta\index.php on line 4 index.php:
(continues) php indexing share|imyour first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the http://board.phpbuilder.com/showthread.php?10371100-RESOLVED-parse-error-unexpected-T_string register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 10 of 10 Thread: [RESOLVED] parse error, http://oshiete.goo.ne.jp/qa/3143490.html unexpected T_string Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode syntax error 02-03-2010,05:55 PM #1 Mike38 View Profile View Forum Posts Junior Member Join Date Feb 2010 Posts 5 [RESOLVED] parse error, unexpected T_string Hi everyone, I'm a newbie to this board, but I'm trying my best to learn. I'm setting up a new domain/website to use .php. I used the following instructions given to me: Converting your HTML flies to PHP Opened a syntax error unexpected file in "CoffeeCup" html editor, called 'index.htm'. At the very top of the page, before even the tag add this code: ------------------------------------------------------------------- echo "Testing that PHP is running ok... success!"; ?> -------------------------------------------------------------------- Now we have a page ready to test for PHP...lets add the PHP functionality for your HTML pages. Download this file: (Its in a .zip) AddType application/x-httpd-php .htm .html and upload it to the root directory of your website, then rename it to '.htaccess' This tells your website server to look for any .htm or .html pages and treat them as if they where a .php page... all without even renaming your pages! Now upload the 'index.htm' page that you added the PHP code to, to your website, and open up your web browser. Type in the name of the uploaded index.htm page, eg; www.mydomain.com/index.htm If PHP is running properly, you should see the message "Testing that PHP is running ok... success!". I did all that........ When I tried to open up the index.htm in my browser (Mozilla Firefox 3.5.7) I got the following error message: Parse error: syntax error, unexpecte
ログイン Q質問する(無料) あなたへのお知らせ トップ 回答コーナー 新着 カテゴリ お題 Q&Aコラム グレード 専門家 遠距離恋愛 ポケモンGO 転職相談 【アンケート】教えて!gooのAI「オシエル」に関するご意見・ご感想をお聞かせください 教えて!goo>[技術者向] コンピューター>プログラミング>PHP>phpと 入力中の回答があります。ページを離れますか? ※ページを離れると、回答が消えてしまいます ページを離れる A回答を続ける 入力中のお礼があります。ページを離れますか? ※ページを離れると、お礼が消えてしまいます ページを離れる お礼を続ける Tweet phpと XML PHP エラー ENCODING UTF-8" 1.0" 解決済 気になる 2件 質問者:eak 質問日時:2007/07/06 06:05 回答数:1件 phpファイルの頭にを入れると Parse error: syntax error, unexpected T_STRING in ・・・ というエラーが出ます。 なぜでしょう? 通報する この質問への回答は締め切られました。 質問の本文を隠す A同じカテゴリの新着質問 A 回答(1件) 最新から表示 回答順に表示 ベストアンサーのみ表示 No.1ベストアンサー 回答者: taketan_mydns_jp 回答日時:2007/07/06 08:59 PHPは、 でも ......?> でもPHPのスクリプトと見なされます。よって、 の中の xml version.....はスクリプトとして認識されています。 こういう場合は、 '; ?> とすれば問題無くなります。 2 件 通報する この回答へのお礼 ありがとうございます!!!!!!!!!! 行けました。 ほんとに助かりました! 通報する お礼日時:2007/07/06 16:06 お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう! 全カテゴリから検索 このカテゴリから検索 Q質問する(無料) このQ&Aを見た人はこんなQ&Aも見ています Parse error: syntax error, unexpected T_STRING in・・・118と出るのですが sy