Hi,

I am trying to get php with Apache to run on a local machine.

It's working fine so far. The php script, however, generates two kinds of links, one of which doesn't work:

  • if the link is localhost/myscript.php then clicking it will let PHP/Apache interpret and I get the loaded regularly. 🙂

  • but if the link is c:/webfiles/myscript.php (where localhost == c:/webfiles/) then the notepad editor opens the myscript.php instead of the script getting interpreted by Apache/PHP. 😕

This drives me nuts. I cannnot change the way the links are generated by the script, so I need to change that behaviour to PHP/Apache opening any php script that gets called from the browser in the localhost directories.

Any ideas?

Thx a lot
Phillip

    Links should not point to c:/webfiles/myscript.php, because if you ever move this to a remote server, they will no longer work.

      Thx for the suggestion. The links are created dynamically in php based on an ini file. Where-ever php finds in the script only the filename (myscript.php) everythings works fine if run on the local machine.

      Whenever however php finds "serverpath/myscript.php" it doesn't call "localhost/myscript.php" but really "c:/.../myscript.php". Clicking then open the editor ad not the php interpreter.

      I had the idea and could try to reinstall the whole php scripts putting "serverpath = localhost/" in the ini file instead of "serverpath = c:/..." but before doing this work I wanted to check whether it is probable that my problem is really located in the ini file, or whether it's an APACHE/PHP setup problem.

      Any ideas? Thx
      Phillip

        For beginners I strongly recommend using Xampp.

        http://www.apachefriends.org/en/xampp.html

        Its an all in one package that install and you are ready to go (Apache, PHP, MySQL, SLL, PHPMyAdmin, etc...), it also installs all the esential tools you will be using. Just give it a try and you wont be dissapointed ! No Config changes needed !

          4 days later

          You might like to take a look at EasyPHP which also installs an all in one AMP (apache, MySQL and PHP ) development platform. Its not secure or advocated as a production setup but is fine for local development. You might need to brush up on your french too - good luck 🙂

          http://www.easyphp.org/

            Write a Reply...