473,322 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

PHP Setup

jm
I am setting up Apache 2.0, PHP5, and PostgreSQL 8.2 on Windows XP. I
have setup everything correctly in the past but recently had to do a
reformat and have to do the installs all over again.

First, I installed Apache with no problems what so ever.

Next, PHP. Again smooth install. With a little tweaking of the
httpd.conf file, Apache was working with PHP.

Next was PostgreSQL. Again, the install went fine and I could use
pgAdmin to connect to the databases.

When I run a PHP file that uses pg_connect() for example, it fails and
says that it is an unrecognized function. I know that the PostgreSQL
extension is in the extension directory.

To start the troubleshooting process, I create a file with phpinfo()
to see what is going on. It says that the php.ini file can be found
in C:\WINDOWS when there is no php.ini file in that directory. I can
do a search on the hard drive for 'php.ini' and the only php.ini file
that is listed is the one in C:\PHP.
My Apache httpd.conf has: PHPIniDir "C:\PHP\"
Also the phpinfo() says that the extension_dir is C:\php5 when it is
not. In C:\PHP\php.ini the extension directory is listed as C:\PHP
\ext.

Lastly, when I do a restart of the computer, try to pull up localhost,
instead of showing any PHP errors, it just shows the PHP source code
in plain text like it has no idea what PHP is, and suddenly the
phpinfo() page that I created is just blank.

If anyone has some ideas to help me out, it would be much appreciated,
I don't want to have to pull out any more of my hair. :)

j

May 31 '07 #1
6 2399
On 31 Mai, 05:32, jm <mister5...@gmail.comwrote:

ok, first of all: why don't you use xampp (www.apachefriends.org)? as
long as you're not on a live-box, there no better way to install
apache and php on a windows-system.
When I run a PHP file that uses pg_connect() for example, it fails and
says that it is an unrecognized function. I know that the PostgreSQL
extension is in the extension directory.
there must be a dll called php_pgsql.dll. look at your php.ini for
"extension=php_pgsql.dll". this line is disabled by default. remove
the ; at the beginning of the line, restart apache.
To start the troubleshooting process, I create a file with phpinfo()
to see what is going on. It says that the php.ini file can be found
in C:\WINDOWS when there is no php.ini file in that directory. I can
do a search on the hard drive for 'php.ini' and the only php.ini file
that is listed is the one in C:\PHP.
have you compiled php by yourself?
in your httpd.conf should be an entry like this one:

PHPIniDir "C:/php"
LoadFile "C:/php/php5ts.dll"
LoadModule php5_module "C:/php/php5apache2.dll"
AddType application/x-httpd-php .php
My Apache httpd.conf has: PHPIniDir "C:\PHP\"
Also the phpinfo() says that the extension_dir is C:\php5 when it is
not. In C:\PHP\php.ini the extension directory is listed as C:\PHP
\ext.
again, have you compiled php by yourself?
regards

May 31 '07 #2
jm wrote:
I am setting up Apache 2.0, PHP5, and PostgreSQL 8.2 on Windows XP. I
have setup everything correctly in the past but recently had to do a
reformat and have to do the installs all over again.

First, I installed Apache with no problems what so ever.

Next, PHP. Again smooth install. With a little tweaking of the
httpd.conf file, Apache was working with PHP.

Next was PostgreSQL. Again, the install went fine and I could use
pgAdmin to connect to the databases.

When I run a PHP file that uses pg_connect() for example, it fails and
says that it is an unrecognized function. I know that the PostgreSQL
extension is in the extension directory.

To start the troubleshooting process, I create a file with phpinfo()
to see what is going on. It says that the php.ini file can be found
in C:\WINDOWS when there is no php.ini file in that directory. I can
do a search on the hard drive for 'php.ini' and the only php.ini file
that is listed is the one in C:\PHP.
My Apache httpd.conf has: PHPIniDir "C:\PHP\"
Also the phpinfo() says that the extension_dir is C:\php5 when it is
not. In C:\PHP\php.ini the extension directory is listed as C:\PHP
\ext.

Lastly, when I do a restart of the computer, try to pull up localhost,
instead of showing any PHP errors, it just shows the PHP source code
in plain text like it has no idea what PHP is, and suddenly the
phpinfo() page that I created is just blank.

If anyone has some ideas to help me out, it would be much appreciated,
I don't want to have to pull out any more of my hair. :)

j
XAMP won't solve your problem because you want PostGres SQL, not MySQL.
No use installing all that MySQL code if you're not going to use it.

As to your problem. It looks like PHP isn't finding the file. Do you
have your PHPiniDir before the LoadModule statement for PHP? Also, I
always use forward slashes - they work fine, even in Windows (except the
command processor), and sometimes backslashes cause problems. You might
try putting PHPiniDir "C:/PHP".

Or, you can handle one problem at a time and for now just copy your
php.ini file to c:\windows (you can always move it once you get things
working, if you wish). Ensure your PostGres dll is loaded in the
extensions section.

I find it interesting that it worked before you restarted. What changes
did you make to your httpd.conf file?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 31 '07 #3
XAMP won't solve your problem because you want PostGres SQL, not MySQL.

of course it will, all he has to do is to active the postgres-dll.
and he gets a clean, accurate installation.
As to your problem. It looks like PHP isn't finding the file. Do you
have your PHPiniDir before the LoadModule statement for PHP?
it should be AFTER the load_module directive.
Also, I
always use forward slashes - they work fine, even in Windows (except the
command processor), and sometimes backslashes cause problems. You might
try putting PHPiniDir "C:/PHP".
you're right, in some cases, php ignores paths given with backslashes
(don't know why).
forward slashes may solve the problem.

regards

May 31 '07 #4
Lammi wrote:
>XAMP won't solve your problem because you want PostGres SQL, not MySQL.

of course it will, all he has to do is to active the postgres-dll.
and he gets a clean, accurate installation.
And he has a lot of disk space unnecessarily taken up by MySQL.
>As to your problem. It looks like PHP isn't finding the file. Do you
have your PHPiniDir before the LoadModule statement for PHP?

it should be AFTER the load_module directive.
Maybe it doesn't make any difference. I always put it before the
LoadModule statement so it's available when the module is loaded.
>Also, I
always use forward slashes - they work fine, even in Windows (except the
command processor), and sometimes backslashes cause problems. You might
try putting PHPiniDir "C:/PHP".

you're right, in some cases, php ignores paths given with backslashes
(don't know why).
forward slashes may solve the problem.

regards

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 31 '07 #5
jm
On May 31, 6:47 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
jm wrote:
I am setting up Apache 2.0, PHP5, and PostgreSQL 8.2 on Windows XP. I
havesetupeverything correctly in the past but recently had to do a
reformat and have to do the installs all over again.
First, I installed Apache with no problems what so ever.
Next, PHP. Again smooth install. With a little tweaking of the
httpd.conf file, Apache was working with PHP.
Next was PostgreSQL. Again, the install went fine and I could use
pgAdmin to connect to the databases.
When I run a PHP file that uses pg_connect() for example, it fails and
says that it is an unrecognized function. I know that the PostgreSQL
extension is in the extension directory.
To start the troubleshooting process, I create a file with phpinfo()
to see what is going on. It says that the php.ini file can be found
in C:\WINDOWS when there is no php.ini file in that directory. I can
do a search on the hard drive for 'php.ini' and the only php.ini file
that is listed is the one in C:\PHP.
My Apache httpd.conf has: PHPIniDir "C:\PHP\"
Also the phpinfo() says that the extension_dir is C:\php5 when it is
not. In C:\PHP\php.ini the extension directory is listed as C:\PHP
\ext.
Lastly, when I do a restart of the computer, try to pull up localhost,
instead of showing any PHP errors, it just shows the PHP source code
in plain text like it has no idea what PHP is, and suddenly the
phpinfo() page that I created is just blank.
If anyone has some ideas to help me out, it would be much appreciated,
I don't want to have to pull out any more of my hair. :)
j

XAMP won't solve your problem because you want PostGres SQL, not MySQL.
No use installing all that MySQL code if you're not going to use it.

As to your problem. It looks like PHP isn't finding the file. Do you
have your PHPiniDir before the LoadModule statement for PHP? Also, I
always use forward slashes - they work fine, even in Windows (except the
command processor), and sometimes backslashes cause problems. You might
try putting PHPiniDir "C:/PHP".

Or, you can handle one problem at a time and for now just copy your
php.ini file to c:\windows (you can always move it once you get things
working, if you wish). Ensure your PostGres dll is loaded in the
extensions section.

I find it interesting that it worked before you restarted. What changes
did you make to your httpd.conf file?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
I did change the slashes and now the 'Loaded Configuration File' is
correct. It still says that the ini path is C:\WINDOWS for some
reason, but I know that it is loading the pgsql stuff. There is now a
section in the phpinfo page that displays that information.

Now the only problem is when I view a page that i have created, I will
either get a blank page with nothing or just the source code. What is
even more confusing about this though, is the the page that is
phpinfo(); works fine. So why is that working, but nothing else?

May 31 '07 #6
jm wrote:
On May 31, 6:47 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>jm wrote:
>>I am setting up Apache 2.0, PHP5, and PostgreSQL 8.2 on Windows XP. I
havesetupeverything correctly in the past but recently had to do a
reformat and have to do the installs all over again.
First, I installed Apache with no problems what so ever.
Next, PHP. Again smooth install. With a little tweaking of the
httpd.conf file, Apache was working with PHP.
Next was PostgreSQL. Again, the install went fine and I could use
pgAdmin to connect to the databases.
When I run a PHP file that uses pg_connect() for example, it fails and
says that it is an unrecognized function. I know that the PostgreSQL
extension is in the extension directory.
To start the troubleshooting process, I create a file with phpinfo()
to see what is going on. It says that the php.ini file can be found
in C:\WINDOWS when there is no php.ini file in that directory. I can
do a search on the hard drive for 'php.ini' and the only php.ini file
that is listed is the one in C:\PHP.
My Apache httpd.conf has: PHPIniDir "C:\PHP\"
Also the phpinfo() says that the extension_dir is C:\php5 when it is
not. In C:\PHP\php.ini the extension directory is listed as C:\PHP
\ext.
Lastly, when I do a restart of the computer, try to pull up localhost,
instead of showing any PHP errors, it just shows the PHP source code
in plain text like it has no idea what PHP is, and suddenly the
phpinfo() page that I created is just blank.
If anyone has some ideas to help me out, it would be much appreciated,
I don't want to have to pull out any more of my hair. :)
j
XAMP won't solve your problem because you want PostGres SQL, not MySQL.
No use installing all that MySQL code if you're not going to use it.

As to your problem. It looks like PHP isn't finding the file. Do you
have your PHPiniDir before the LoadModule statement for PHP? Also, I
always use forward slashes - they work fine, even in Windows (except the
command processor), and sometimes backslashes cause problems. You might
try putting PHPiniDir "C:/PHP".

Or, you can handle one problem at a time and for now just copy your
php.ini file to c:\windows (you can always move it once you get things
working, if you wish). Ensure your PostGres dll is loaded in the
extensions section.

I find it interesting that it worked before you restarted. What changes
did you make to your httpd.conf file?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

I did change the slashes and now the 'Loaded Configuration File' is
correct. It still says that the ini path is C:\WINDOWS for some
reason, but I know that it is loading the pgsql stuff. There is now a
section in the phpinfo page that displays that information.

Now the only problem is when I view a page that i have created, I will
either get a blank page with nothing or just the source code. What is
even more confusing about this though, is the the page that is
phpinfo(); works fine. So why is that working, but nothing else?
The fact that the phpinfo() page is working correctly indicates your PHP
is installed correctly.

However, you haven't told us enough to determine which of about a
thousand possibilities could be the problem.

For instance - does your file end with .php? Are you using <?php to
start your php code? Are there any errors in your code? Try these
settings in your php.ini file:

error_reporting = E_ALL
display_errors = On

But don't leave display_errors on for a live site!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 31 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Richard Shea | last post by:
Hi - This is probably quite a stupid question but I've never understood what setup.py does. I've got a situation at the moment where I would like to use a script (which someone else has written and...
4
by: pbj | last post by:
my application was created in vb.net, vs 2003. the setup project was also created in vs 2003. one of my application reviewers reported this: The .Net link that is included in the setup is not the...
2
by: serge calderara | last post by:
Dear all, I have build a setup project for my VB.NET application, I need to know the installation path of an application in order to add file in it. How can do that inside my setup project ?...
5
by: paul kölle | last post by:
hi all, I noticed that setUp() and tearDown() is run before and after *earch* test* method in my TestCase subclasses. I'd like to run them *once* for each TestCase subclass. How do I do that. ...
0
by: Adam Clauss | last post by:
I have a C++ COM Addin I wrote for Outlook (2002) using VS.Net 2002. Having completed it, I am now looking to create a setup project and install it on another machine. I created a setup project...
4
by: Howard Kaikow | last post by:
When I build a setup project, the dependency in the setup project is tied to the version in which it was built. Is there a way to build a setup project that can be used in both versions of the...
2
by: A.Carter | last post by:
I am developing a windows application with Visual Studio 2003 using C#. The application is complete so naturally I went to create a setup package. I added a setup project to the solution and I went...
1
by: rohan_from_mars | last post by:
I have a windows service and am also using Enterprise Library June 2005 version. Now i have created Setup and Deployment Project which installs the service. but how do i add EL dlls-...
6
by: andrewbb | last post by:
I want to deploy a service with a windows app and the setup program must conform to the Vista certification requirements. Can that be done with the standard .net setup project? Assuming cost is...
6
by: Srini | last post by:
Hi, I am facing a problem in localizing the setup file and .NET framework redistributable. I am trying to deploy c# winform application. I have created a setup project. I need to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.