duan3601 2014-11-11 07:06
浏览 540
已采纳

在php中使用“use”时出错

In my code, the server returns error when using the term "use". For example the following code:

use Spire\Settings;
use Spire\Resources;
use Spire\Utils;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

use Silex\Application;

The server returns me the following error:

PHP Parse error:  syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home/inoshare/public_html/api/app.php on line 8

What is wrong with the server configuration?

  • 写回答

2条回答 默认 最新

  • dongyou5068 2014-11-11 07:12
    关注

    @touchmx,Please check my below notes.

    Notes :

    (1) Make sure It's running PHP 5.3 or later.

    (2) If they are running an earlier version they won't have support for namespaces.

    Please check phpinfo() for PHP version.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥15 Stata 面板数据模型选择
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏