SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Grand Rapids, MI
    Posts
    1,284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Use the power of the PHP executable

    Using php.exe you can easily check your code for error. By running this command at a command line:

    php -l <FileName>

    ex.) php -l C:\text.php

    PHP will check the file for errors. This saves you from having to upload it and test. Of course that would be too tedious for most people so get yourself a good text editor that has the option of running tools. This way you can easily check the current file being edited. (ex.) TextPad, Editplus)

    The are many other commands you can use too. Just type

    php -h

    at a command line prompt to see the other options.

    EDIT: To do this is EditPlus just go to Tools < Configure User Tools. Then click Add Tool < Program. Next to the Command box is a little button, click and browse for php.exe. In the Argument box type -l and then click the little arrow next to the box. Select FileName from the list. The Argument box should look like: -l $(FileName). Then select Capture Output. Click ok and go to View < Toolbars/Views < Output Window. Then just open a PHP document and click on the tool icon an the output should display in the Output Window.

  2. #2
    SitePoint Member insomica's Avatar
    Join Date
    Apr 2003
    Location
    Houston, TX
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    where can you get php.exe from?

  3. #3
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by insomica
    where can you get php.exe from?
    It should be in your php installation folder.

  4. #4
    SitePoint Zealot poLka's Avatar
    Join Date
    Apr 2003
    Location
    GF
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    will it make any changes or just tell you where errors are? and provide suggestions? (scared to run it)

  5. #5
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Grand Rapids, MI
    Posts
    1,284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It will just tell you where the errors are.

  6. #6
    SitePoint Member charlieTuna's Avatar
    Join Date
    May 2003
    Location
    Chicago
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just in case the folks with rainbow apple avatars are using mac os x, they should be aware that the php command line interface is not available with the php in mac os x. if you want the command line interface, you'll need to build your own php or download one which does include it. last time i checked, the one marc at entropy.ch provides is just the apache module.

  7. #7
    SitePoint Zealot poLka's Avatar
    Join Date
    Apr 2003
    Location
    GF
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i compiled my php from the source files... is it an option that i'd have to select at compile time?

  8. #8
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can use the CGI to run apps, or the CLI (PHP 4.3.0+)
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •