Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
652 views
in Technique[技术] by (71.8m points)

php - Getting a syntax error unexpected T_STRING for namespace line

Well, I keep getting

Parse error: syntax error, unexpected T_STRING in /path/to/index.php on line 2

Googled my arse off and still nuthing, so far the index.php contains:

<?php
namespace Infire; # Line 2
...

I am using PHP 5.1

Any ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The PHP namespace is only supported in PHP 5.3+ version

Check this PHP 5.3.0 Release Announcement


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...