I can not understand why this error pops up. Here is the code of the file, in which the error Fatal error is: </ in / var / www / html / phpinstagram / phpinstagram / Instagram.php on line 2

<? namespace phpinstagram; class Instagram { /* * @var array */ protected $_commands = array(); /* * @var \phpinstagram\Instagram\Client\Communication */ protected $_communication; /* * @var \phpinstagram\Instagram\Api\Feed */ public $feed; /* * @var \phpinstagram\Instagram\Api\Auth */ public $auth; public function __construct() { $this->feed = new \phpinstagram\Instagram\Api\Feed(); $this->feed->setInstagram($this); $this->auth = new \phpinstagram\Instagram\Api\Auth(); $this->auth->setInstagram($this); $this->_communication = new \phpinstagram\Instagram\Client\Communication(); } public function addCommand(\phpinstagram\Instagram\Command\ICommand $cmd) { $this->_commands[] = $cmd; } public function run() { $executed = array(); //$cookieJar = null; foreach ($this->_commands as $utcmd) { if ($utcmd instanceof \phpinstagram\Instagram\Command\ICommand) { /* * @var \phpinstagram\Instagram\Command\ICommand */ $cmd = $utcmd; //if (!is_null($cookieJar)) // $this->_communication->getClient()->setCookieJar($cookieJar); foreach ($cmd->dependsOn() as $dependency) { foreach ($executed as $previous) { if (get_class($previous) == '\Instagram\Command\\' . $dependency) { break 2; } } throw new \phpinstagram\Instagram\Command\DependencyException( 'Command ' . get_class($cmd) . " depends on $dependency but it never was executed!\n\n" ); } $cmd->setCommunication($this->_communication); $cmd->validate(); //echo get_class($cmd)." is valid. executing...\n\n"; $cmd->exec(); $executed[] = $cmd; // reset parameters $this->_communication->getClient()->resetParameters(); //$cookieJar = $this->_communication->getClient()->getCookieJar(); } } // reset commands $this->_commands = array(); } 

}

  • one
    Who taught you the abbreviated syntax to use? Php code should start like this: <?php - BOPOH
  • no comment on the case. Who taught you to leave comments that are not meaningful and have nothing to do with the discussion? - janicheg
  • one
    comment on the case, because otherwise the next time you come with a question: everything worked on the old server, but does not want to here. Also, have you tried the proposed revision? Maybe because of this, and you do not work anything? Especially since with me (with <?php ) your error is not reproduced - BOPOH
  • Dear, Raven, if the error were due to short_tags, I would not be here useful. Your advice is not competent at all. Clever can go to university and teach students there. If you have DELIVERY sentences, you can write, if not - please leave. - janicheg
  • I have already given you one practical offer, the second - read how to ask such questions. Now you have a lot of superfluous code, and your problem is not reproduced - BOPOH

1 answer 1

Resolved, the answer can be found here: stackoverflow