[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 638
  • Last Modified:

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

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
Yashy
Asked:
Yashy
2 Solutions
 
GaryCommented:
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
 
YashyAuthor Commented:
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
 
GaryCommented:
That's where you currently have it. I thought you wanted to change it?
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
YashyAuthor Commented:
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
 
GaryCommented:
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
 
YashyAuthor Commented:
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
 
Dave BaldwinFixer of ProblemsCommented:
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
 
rinfoCommented:
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
 
YashyAuthor Commented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now