1

I am currently working on pset8, specifically 'import'. For some reason, there is no syntax highlighting in the file, which makes it a bit difficult to work with. I have had this happen before (to files with a .'php' extension), but refreshing the IDE page would do the job of fixing it. It doesn't now. Has anyone encountered this before? Is there some way to fix it?

2

Don't worry -- nothing bad will happen if you rename the file. The point of naming it import rather than import.php is just to show you that this isn't a regular PHP web app file to be executed by the Apache2 server, this is a PHP-CLI (command-line interface) script, so it doesn't require the .php extension.

It does, however, need to start with a "shebang" line like #!/usr/bin/env php -- and it requires the executable bit to be set for the user, though no permissions are needed for the group or world. Use chmod 700 on the entire bin directory and all its contents to accomplish this.

As long as your file has the shebang and is set u+x, no harm will befall you if you copy or move the file to import.php. This will restore the syntax highlighting and code completion features of the c9 editor that you're missing. And you can always mv the file back to just import when you are done.

By the way, if you consider your question answered, please click on the green check mark to accept one of the answers. I don't care whether you pick my answer or ihor's (which was correct, and posted before mine!) I just want to keep this from turning into a ZOMBIE QUESTION that will haunt the forum forever.

1

you need to rename import to import.php

1
  • 1
    Thought so, but I was worried that it might mess up the file. Surely, staff left it without the PHP extension for a reason? Or am I wrong?
    – iCode95
    Aug 31 '16 at 14:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .