0

I am trying to run a spawn-fcgi script for php but I get the below error.

spawn-fcgi -n -d /home/ubuntu/workspace/Gold-Lantern/glPixelServer/php/ -s /tmp/nginx9010.socket -u www-data -f /home/ubuntu/workspace/Gold-Lantern/glPixelServer/php/pixel.php
/home/ubuntu/workspace/Gold-Lantern/glPixelServer/php/pixel.php: 1: Syntax error: newline unexpected

Below is the contents of the script:

<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
<?php
echo "Hello World!";
?>
</body>
</html>
Tampa
  • 75,446
  • 119
  • 278
  • 425

1 Answers1

1

Solution #1: Your first line should be:

#!/usr/bin/php

and make sure the permissions are set to execute (chmod a+x )

Solution #2: Change the launch command to:

... -u www-data -f /usr/bin/php /home/ubuntu/workspa...
Ja͢ck
  • 170,779
  • 38
  • 263
  • 309