Help with Configuring PHP

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

Help with Configuring PHP

Post by james3302 »

I have installed PHP5 on the new server. Copied over all the website files from the old server(that was using PHP4.something). The php "first layer" of php files work, I just had to rename then from php4 to php. But a few layers down they do not work. I renamed them .php and it acts like the file does not exist with I do

post = filename.php

But if I link it directly I see tyhe contents of the php and html code gets parsed. The first layer of php files are all php and I echo the html code. Seeing as I cannot have html code and php code in the same file. I could not find a .htaccess file, but I am running IIS so I think IIS sets that stuff up.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Do you have a question?
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

Progam Files?

Post by james3302 »

I was going through the link on how to setup PHP with IIS. The only link that works on the sticky post about it. And setting up the PHP ISAPI extensin and it does not like my path c:\Progam Files\PHP

Im afraid thats because Program Files are two words, but thats how the windows installer set it up. So I have to move the files into C:\PHP and change everything the installer setup great.
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

Yea

Post by james3302 »

Can anyone help figure out why the PHP files are parsed when there's not HTML code in them, but when I have html code in them the HTML code is parsed and the PHP code is displayed. Any why does the windows installer that comes with php5 setup php in c:\program files when I have to turn around and move it, and re configure it so it will work.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Are the file extensions properly matched so PHP will pick them up?

As for the Windows installer, I've never used it. I always use the zip on Windows machines.
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

A Manual Install

Post by james3302 »

Yea I thought about it, but the readme file that comes with it is messed up. It says do this and this, then do this like it says to in the section labeled "whatever". I have to read that section then find my place back up in where I left off at. Needs to written in a more straight forward manner. Well I am reading through the link and it says someting installed PHP ISAPI or something. The only extension I have installed is php. It was installed from the setup routine. I dont even know the difference between a cgi or isap web server. I dont know which one I have. All I know is that i have IIS
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

the link says

Post by james3302 »

The link says to add the PHP ISAPI extension. It has the same path as the .php extension that is already installed. I went to add the extension as it says in the link im looking at and it says to name it PHP ISAPI, but there's no place to name it. Just a place to put an extension.

Which extensions do I need?

I have these extensions listed
.asp
.cer
.cdx
.asa
.htr
.idc
.shtm
.shtml
.stm
.printer
.php
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

seems right

Post by james3302 »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


It seems setup right I can get a test php file that calls phpinfo() to work, I threw in some HTML code and it worked, but this file still does not work. Here part of the file contents

Code: Select all

<HTML> 

<HEAD> 

<TITLE>Nebraska WireCenters - Live Query</TITLE> 

</HEAD> 

<BODY BGCOLOR="#d5d2bb">

<CENTER><B>All Nebraska WireCenters - Live Query</B><br>
<br>As of:<br>


<?php 
$db="(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = MTNELNKE110)(PORT = 1521))
    (CONNECT_DATA = (SID = CADE))
  )"; 

$connection = OCILogon("altdba","dba1",$db);

// Define Wire Centers

$wc1 = "ADAM";
$wc2 = "ALEX";
$wc3 = "ASHD";
$wc4 = "AUB";
$wc5 = "AVOC";

$stmt = OCIParse($connection, "select '$wc1' LOCATION, $query TOTAL from $wc1$table union 
			       select '$wc2' LOCATION, $query TOTAL from $wc2$table union
			       select '$wc3' LOCATION, $query TOTAL from $wc3$table union
			       select '$wc4' LOCATION, $query TOTAL from $wc4$table union
			       select '$wc5' LOCATION, $query TOTAL from $wc5$table union

OCIExecute($stmt); 

echo( date("l, F dS Y.") );

// Start of table and column headings (ID and Name)

print "<br><br>\n";

if ($table == ".cable where rb_state = 2") 
echo ("<b>Total of All Copper Cable</b><br><br>");

if ($table == ".cable where type=32 and rb_state = 2") 
echo ("<b>Total of Aerial Air Core Cable</b><br><br>");

if ($table == ".cable where type=30 and rb_state = 2") 
echo ("<b>Total of Buried Air Core Cable</b><br><br>");
And here's the output I get

All Nebraska WireCenters - Live Query

As of:
Total of All Copper Cable

"); if ($table == ".cable where type=32 and rb_state = 2") echo ("Total of Aerial Air Core Cable

"); if ($table == ".cable where type=30 and rb_state = 2") echo ("Total of Buried Air Core Cable

and so forth.

Is there something here that will not work with versin 5. Maybe i should just install version 4 again. Now that i have a clue as to how to manually install it.


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

Stupid question

Post by james3302 »

These php files seem to go caput when its trying to connect to the Oracle DB. So I figure an Oracle client needs to be installed on that server for it to use the tsnames.ora file and the other Oracle things needed to connect. Just an idea.
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

adding oracle extensions

Post by james3302 »

I think I have found the problem, Posted it in the database forum, but no one seems to answer there about it.

I do not have the oracle extensions installed. I copied oci.dll from the oracle directory
put it into the php folder, renamed it php_oci.dll
put thit line in the php.ini file
extension=php_oci.dll;


I did not see anywhere else in the file where extensions were installed but I saw a part and talked about it so I put it right under that(making that it would not be commented out)

I also restarted IIS.

still nothing.

So I downloaded the files and im going to try and see if it works now.
nope still not working
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You will have to have some patience. Few developers here work with Oracle systems regularly, if at all.
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

okay

Post by james3302 »

Im having the old server brought over, Im going to fire it up and see what the php.ini file looks like and some other things to try and see what the difference it.
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

well

Post by james3302 »

I setup PHP4.0 and im getting errors msgs now(better than no msgs). whether I use the orant folder that I copied from the old server, the ora102(oracle 10.2 client library that I downloaded) ot the ora92(oracle 9.2 I installed) I get the same error msgs.

ora-12222 and once time I got ora-12505. I dont know what the listener.ora file is, but I looked at it on the old server and there's no mention in it about the SID that the older server used to connect to.
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

Updates

Post by james3302 »

I have 5.2.4 working and php -v works with no errors this time. My php file says that the connect to oracle is no good. I used a if statement to check that. I have a oci8 spot in the phpinfo() function and here it is

OCI8 Support enabled
Version 1.2.4
Revision $Revision: 1.269.2.16.2.38 $
Active Persistent Connections 0
Active Connections 0
Temporary Lob support enabled
Collections support enabled

Directive Local Value Master Value
oci8.default_prefetch 10 10
oci8.max_persistent -1 -1
oci8.old_oci_close_semantics 0 0
oci8.persistent_timeout -1 -1
oci8.ping_interval 60 60
oci8.privileged_connect Off Off
oci8.statement_cache_size 20 20

I have also included a ODBC because I believe that this is the problem, I do not have a Oracle ODBC Driver installed and so soon as I figure out how to install one I will.

odbc
ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library Win32

Directive Local Value Master Value
odbc.allow_persistent On On
odbc.check_persistent On On
odbc.default_db no value no value
odbc.default_pw no value no value
odbc.default_user no value no value
odbc.defaultbinmode return as is return as is
odbc.defaultlrl return up to 4096 bytes return up to 4096 bytes
odbc.max_links Unlimited Unlimited
odbc.max_persistent Unlimited Unlimited
james3302
Forum Commoner
Posts: 53
Joined: Thu Aug 02, 2007 11:11 am

fixed

Post by james3302 »

I have to change the SID(someone had to tell me what it was) and When using method = post and action = filename in php 4 I guess it was just passed as the variable name with a $ placed in front of it. I had to do this at the beginning of each php file.

$table = $_POST["table"]; and so forth.
Post Reply