Solved

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

Posted on 2013-10-27
9
622 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

830 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