Closed Thread Icon

Topic awaiting preservation: getting PHP to work on a virtual host, on a local Apache Pages that link to <a href="https://ozoneasylum.com/backlink?for=30686" title="Pages that link to Topic awaiting preservation: getting PHP to work on a virtual host, on a local Apache" rel="nofollow" >Topic awaiting preservation: getting PHP to work on a virtual host, on a local Apache\

 
Author Thread
poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 12-02-2008 19:38

Oy,

If there is one thing I'm really not goodly at in webdev, it's anything server/admin side. Whenever I need to do "backend" stuff I fire EasyPHP and that's good enough. Yesterday I got a virtual host running but PHP isn't executed. Any idea why ?

My httpd-vhosts.conf is pretty basic:

code:
NameVirtualHost *:80

<VirtualHost *:80>

    DocumentRoot D:/code/php/p01/p01.org.v7.5/
    ServerName p01.dev
    ServerAlias www.p01.dev

</VirtualHost>

And whenever I try to add a LoadModule directive to "force enable" PHP, Apache barks upon restart about PHP being already loaded.





(Edited by poi on 12-02-2008 19:38)

kuckus
Paranoid (IV) Mad Librarian

From: ber/ger
Insane since: Dec 2001

posted posted 12-02-2008 21:12

Hmm, a number of things might be going wrong, also depends on your main httpd.conf / apache2.conf and wahtever else you might have in place.

Maybe just start with two things that I don't see up there in your config but in mine:

  • AddType application/x-httpd-php .php
  • DirectoryIndex index.html index.htm index.php



Esp. the first one should be present "somewhere"... though it might be in one of your other config files.

How is the PHP module being loaded, using Apache's mod-{available|enabled} mechanism or does the Windows release have some other tricks for that?

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 12-02-2008 22:04

I don't seem to need the DirectoryIndex in the VirtualHost tag as my browsers pick up the index.php or index.htm automagically.
I tried adding the AddType directive in the VirtualHost tag, without success. It doesn't change anything. My browsers still pick up the index.php as text/html


I just flashed!

I was using the <? /* foo */ ?> syntax. But I saw something a while ago that PHP5 ( or is it EasyPHP 2.0 ) requires the <?php /* foo */ ?> syntax. I just tried and it works.

Tsssk. When I said I'm not goodly with the back end.


Thanks for giving it a shot.

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 12-03-2008 02:40

hmmm...I'm running PHP5 and I don't have to use <?php /* foo */ ?>

But like kuckus said, you should have in your /etc/apache2/apache2.conf file you should have

AddType application/x-httpd-php .php
AddType applicavtion/x-httpd-php-source .phps

If it's working then I guess it really doesn't matter

Later,

C:\

kuckus
Paranoid (IV) Mad Librarian

From: ber/ger
Insane since: Dec 2001

posted posted 12-03-2008 23:57

Ah OK... then you have these settings in your apache2.conf already.

If you like the shorter form you can just change the tag style in php.ini:

code:
short_open_tag = On

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 12-04-2008 21:29

Thanks!

« BackwardsOnwards »

Show Forum Drop Down Menu