Re: PHP Setup



jm wrote:
On May 31, 6:47 am, Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> wrote:
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...@xxxxxxxxxxxxx
==================

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.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: PHP Setup
    ... Next, PHP. ... Again smooth install. ... I know that the PostgreSQL ... extension is in the extension directory. ...
    (comp.lang.php)
  • Re: PHP Setup
    ... reformat and have to do the installs all over again. ... Apache was working with PHP. ... extension is in the extension directory. ... phpinfo() page that I created is just blank. ...
    (comp.lang.php)
  • RE: [PHP] Xampp question, pretty much 0T
    ... I suggest you look into VMWare. ... versions (player, server, etc) if you don't want Workstation (which I ... [PHP] Xampp question, pretty much 0T ... recommended it to me when I asked for an easy install of AMP. ...
    (php.general)
  • HOWTO: FreeTDS for Newbies (almost complete)
    ... One way to do that is to install FreeTDS, recompile PHP, ... You can go to freetds.org and install the RPMs on Unix or Linux ...
    (comp.lang.php)
  • Re: [SLE] updating to PHP5
    ... while running PHP 5 for my stuff. ... managed by SuSE staff where you can download latest apache with all ... SLES 9 doesn't need PHP for its default configuration. ... Thus, it seems possible to remove PHP4, install a new Apache instance, PHP5 ...
    (SuSE)