Government Security
Network Security Resources

Jump to content

Photo

Run Code Starting With...#!/usr/bin/php?

- - - - - perl php
  • Please log in to reply
8 replies to this topic

#1 Tiago2

Tiago2

    Private First Class

  • Members
  • 39 posts

Posted 10 September 2007 - 08:52 PM

Hi all, I've been trying to run code starting with #!/usr/bin/php. Im not to knowledgeble with this. I can't figure out how PERL can open it... or is it even perl? Any help?

#2 genxweb

genxweb

    Corporal

  • Members
  • 191 posts

Posted 11 September 2007 - 03:53 AM

It is php code.

#3 rlastinger

rlastinger

    Sergeant

  • Members
  • 220 posts

Posted 13 September 2007 - 10:12 AM

It is php code.


yep, php. #!/usr/bin/perl is for perl code

#4 APX

APX

    Specialist

  • Members
  • 110 posts

Posted 13 September 2007 - 10:41 AM

Tiago2, the line #! informs the linux shell the interpreter needed to run the code in scripts.
you can find #!/bin/bash, #!/usr/bin/perl, etc etc.
That's why they tell you that code is PHP

#5 Tiago2

Tiago2

    Private First Class

  • Members
  • 39 posts

Posted 15 September 2007 - 05:29 PM

Oh see..., is it possible for me to run it in windows not linux?

#6 Mystique

Mystique

    Private First Class

  • Members
  • 35 posts

Posted 15 September 2007 - 08:11 PM

You can if you use something like XAMPP.

It creates a 'server' environment on your 'doze machine, by installing apache, mysql, php, perl, etc.

It gets the 'server' environment up and running so you can get to coding pretty quick like ...

I have used this in the past ... even created an installation tutorial for it at one time ...

I'm sure there are other solutions as well, but this one I have had first hand experience with.

Hope this helps ....

Mystique

#7 webdevil

webdevil

    Retired GSO General

  • Sergeant Major
  • 1,195 posts

Posted 16 September 2007 - 12:19 AM

simply download the php installer from

www.php.net/downloads.php


and go to command prompt and just type in

php c:\blabla\youphpfile.php



#8 Tiago2

Tiago2

    Private First Class

  • Members
  • 39 posts

Posted 16 September 2007 - 02:36 PM

Got it working. Thanks guys

#9 APX

APX

    Specialist

  • Members
  • 110 posts

Posted 17 September 2007 - 06:04 AM

Just a quick note.. if you installed one of those apache, mysql, php, perl auto installers auto configurable, check to disable the services autostart or you will be offering a default, unpatched apache server.





Also tagged with one or more of these keywords: perl, php