Solved

Php configuration for Apache on Windows server.....not working

Posted on 2013-10-27
9
612 Views
Last Modified: 2013-11-14
hi guys,

We've installed php 5.3.3 (Vc6 module) on Windows 2008 R2, along with Apache 2.2 (downloaded from apache.org). When running the actual phpinfo.php file on the localhost, we're seeing that the environment for Apache is pointing to the incorrect locations. I've attached a screenshot. They're outputting to the Microsoft folders, when they shouldn't. IIS has completely been removed too, so we don't understand why the path isn't going to the actual correct location.

Any ideas on resolving this?

Thanks
Yash
desktop.jpg
0
Comment
Question by:Yashy
9 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39604038
Open httpd.conf and search for DocumentRoot and change the path to where you want it to go
Also search for:
<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs">
and change the path again to the same as above.
Save the file and restart Apache.
0
 
LVL 1

Author Comment

by:Yashy
ID: 39604094
hi,

the documentroot in the httpd.conf is pointing to the location:

"C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs"

Is that right?
0
 
LVL 58

Expert Comment

by:Gary
ID: 39604105
That's where you currently have it. I thought you wanted to change it?
0
 
LVL 1

Author Comment

by:Yashy
ID: 39604115
That's what I don't get! Why is the phpinfo file picking up the apache environment as the one in the IIS express folder and not the one in the htdocs folder?
0
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!

 
LVL 58

Expert Comment

by:Gary
ID: 39604121
It is looking for PHP according to the system vars
Click Start, right click My Computer
Click Advanced Settings
Advanced Tab, click Environment Variables button at the bottom
This will list where your system is looking for default programs
If you need to change then just edit the value and change the path.
0
 
LVL 1

Author Comment

by:Yashy
ID: 39604185
I've done that, i've changed it to the supposed right location.

On the command prompt, i've then done the following:

cd C:\Program Files (x86)\Apache Software Foundation\PHP\     (location of PHP)

then run the following:

php.exe index.php

And it comes up with the error below i've attached. If we comment this out, then it just skips to the next error meaning that it may not be an actual .dll file error but a configuration error?
desktop-2.jpg
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
ID: 39604335
You may be finding that Apache and PHP because of their roots in Unix/Linux do not like the spaces in the path names.  I installed PHP 5.4 in C:\PHP and Apache2.4 in C:\Apache24.  But I also used the VC9 versions which means Apache came from http://www.apachelounge.com/download/  The VC9 builds are found in a link in the left column.  The current versions of PHP 5.3 and 5.4 are VC9 builds.

Apache also uses the 'ts' or Thread Safe version of PHP where IIS wants the 'nts' or Non-thread Safe version.  'httpd.conf' on my system has two lines relating to PHP.  One is for the DLL module and the second is for the location of 'php.ini'.

Also for Apache to run on port 80, IIS must be Uninstalled, not just disabled.
0
 
LVL 9

Accepted Solution

by:
rinfo earned 250 total points
ID: 39605281
Seems like you have installed both php and apache in the same directory.
As you are running phpinfo besides cli command from apache installation directory it is
obivious that you have installed php in the same directory as apache.
What i do is have  3 directory apache,php and mysql in c drive, and install these in their respective directory.Besides i assign another directory - created by me - htdocs  in the root
of c i,e C:\htdocs. And assign this path to apache config for root dir.
At the same please check include dir path in php.ini to  include_path = "c:\php\includes"
doc_root = C:\htdocs and extension_dir = "C:\php\ext" this is the bare minimum required for proper functioning of php . Please check this for your installation.
0
 
LVL 1

Author Comment

by:Yashy
ID: 39648183
hey guys,

excuse the hiatus, i've managed to get it up and running by entirely removing the installations and re-installing everything again.

I then went ahead and downloaded Apache from the apache lounge as I could then use VC9 files for the installations. All is well now though.

And again, sorry for not responding earlier.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

708 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

15 Experts available now in Live!

Get 1:1 Help Now