Solved

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

Posted on 2013-10-27
9
625 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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 83

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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
if statement malfunction 5 43
php hashing methods 3 45
Form not executing correctly 1 24
PHP MYSQLI Connection in Function in a class 4 25
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

739 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