Results 1 to 7 of 7
  1. #1

    PHP scripts won't execute in browser

    Hi, I've got what I thought was a simple problem.

    I'm working on Linux with Apache and I've installed the latest version of PHP as a CGI binary.

    I can run PHP scripts at the command line, without a problem. However, I want to also be able to run these scripts in the browser (like a normal php page).

    What do I need to add to httpd.conf to make this happen? I tried addint the AddType for php but that doesn't seem to solve this.

    Or do I now to need install PHP as an Apache module as well?


  2. #2
    I have not heard of a browser that would execute embedded PHP. PHP is basically a server-side language like Perl. Even though I run PHP under Windows for some local programming I have not seen a browser addon for this. Of course, on the server, a normal .PHP program would execute and not deliver PHP code (this delivery sometimes happens when there is a coding error). There might be a way to print the code as a string and have it delivered to the browser, or maybe embedding it in a .html page. Hmmm.

  3. #3
    Hmm, I think might have stated my problem wrong. I don't want to execute the PHP scripts in the browser.

    All I want to able to do is visit the page in my browser, test.php and it work, like a normal PHP script.

    I mean it works great at the command line as a PHP CGI binary. But I know there is a way to get it to run in the browser. Do I just have to install as PHP apache module as well? Or is there another way?

  4. #4
    That is what execute the PHP scripts in the browser means.

  5. #5
    Ok, I think I should probably restate my problem, as I think I that was source of my larger problem.

    What I want do is the following: run php code through the web server (Apache) and serve this to webpages & also run php code from the command line in Linux.

    Is there a way I can be happy with both? Do I install PHP as a apache module or CGI binary to accomplish this? If Apache module, what do I have to do t get scripts to run at the command line? Or is it just php ScriptName ?


  6. #6
    Join Date
    Aug 2002
    Baltimore, Maryland

  7. #7
    Join Date
    May 2002
    Edmonton, Canada

Posting Permissions

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