Solved

php redirect

Posted on 2013-06-08
12
216 Views
Last Modified: 2013-06-12
I am using DW and I have php installed and this works (easy php)
I need to run php files but how do i set the current folders I am working to work with php?
0
Comment
Question by:jagguy
  • 6
  • 4
  • 2
12 Comments
 
LVL 3

Expert Comment

by:Bogeholm
ID: 39232669
Hi Jagguy

Are you running a Local webserver? If yes, is it IIS on Windows?
0
 

Author Comment

by:jagguy
ID: 39232908
Hi,
I am running apache (easyPHP)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39233043
Yeah okay that is just a installer for wampserver.

You just run the files using localhost:

http://localhost/yourfolder/yourfile.php

Cd&
0
 

Author Comment

by:jagguy
ID: 39234196
ok but localhost points to a directory I dont want to place my php files.
I need to redirect my php dir so the files can be picked up
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39235422
Either change the wampserver config to point where you want it to point; change the location of your files, or change all the hrefs to use a path that traverses from wampsers default to your folders.

Cd&
0
 

Author Comment

by:jagguy
ID: 39236420
yes where do i do this again?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39236452
for windows 7 the host file is generally at:

c:\windows\system32\drivers\etc\host

Cd&
0
 

Author Comment

by:jagguy
ID: 39236641
My files for php are located in e:/program files/easyPHP/www

I want the dir of this moved so I can run php files from another dir. In Php.ini or httpd.conf how do i do this again exactly?

I want to run php files in e:/website/<another folder>
0
 

Author Comment

by:jagguy
ID: 39237626
I really dont know what to do here and what setting to change so I can run php files from a dir of my choice
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39238285
The files have to be under the root.  The wampserver directory is the root.  The server cannot access or see what is not below it in the hierarchy.

You cannot do localhost/e:/website...

It must be localhost/website... and the website foler must be inside the folder where the serve is.

Cd&
0
 
LVL 3

Accepted Solution

by:
Bogeholm earned 500 total points
ID: 39239200
Hi,
To change the default 'site folder' in Apache, you need to right click on the icon on the Easyphp icon on the taskbar and select configuration->Apache. This will open httpd.conf in a notepad window

Find DocumentRoot and the section: DocumentRootDirectory and modify the path to your preferred path, Where you find the default path.

Pay attention to Where to use '/' and '\'
0
 

Author Comment

by:jagguy
ID: 39239654
This is what i did to make it work but the VirtualHost

DocumentRoot "D:/code"
(...)
# DocumentRootDirectory
<Directory "D:\code">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
 </Directory>
 (...)
 NameVirtualHost 127.0.0.1
 <VirtualHost 127.0.0.1>
   DocumentRoot "D:/code/"
   ServerName localhost
 </VirtualHost>
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now