Introduction to Socket Programming with PHP
Subject:   Re: unable to run this script
Date:   2003-01-26 23:03:12
From:   dsolin
Response to: Re: unable to run this script

Hi again!

Given that /var/www/html is your web root, you can either run the script by making a usual HTTP request:


Or, you can (is you indicate above) run it via the command-line. However, to do this you must have PHP as a binary (a program that can interpret PHP code). If you don't know if you have this, try the following:

root@localhost# cd /var/www/html/sock
root@localhost# php sock.php

If this get the script executed, you're safe. If it returns a "php: command not found", you need to install/compile a PHP binary.

When you do have a PHP binary, you can also add a so-called "shebang" at the top of your script:


and then do a 'chmod 755 sock.php' to make it executable. By this, you will be able to run the script by just typing its name on the command-line:

root@localhost# cd /var/www/html/sock
root@localhost# ./sock.php

Hope this helps!


1 to 2 of 2
  1. Re: unable to run this script
    2003-01-29 03:11:42  manjay_dwivedi [View]

  2. Re: unable to run this script
    2003-01-29 02:45:00  manjay_dwivedi [View]

1 to 2 of 2