Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

phpinfo.php 1

Status
Not open for further replies.

TaiChi56

Technical User
Mar 6, 2002
188
US
I put in the following code using Notepad:
<? phpinfo(); ?>
I saved it as phpinfo.php

I put this in the htdocs folder in the Apache directory.
When I go to my browser and put in
I get a popup that says, do you want to open it or save it.
I open it and all I get is the code I wrote.

I am suppose to be getting information about variables in PHP, right??

Thank you. The secret to education lies in respecting the student. {Ralph Waldo Emerson}.
 
check through your httpd.conf for this

<IfModule mod_php4.c>
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

and make sure that the .php is in there. ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
It was not in the httpd.conf, so I went ahead and added it. It still came back with the same results. What next?
Thanks for your help. The secret to education lies in respecting the student. {Ralph Waldo Emerson}.
 
Once added, restart apache and everything should hopefully work. ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
I restarted Apache. It still gives me the popup window to open or save. When I open it, it open in Wordpad and shows me the one line of code. The secret to education lies in respecting the student. {Ralph Waldo Emerson}.
 
probably a silly question, but do you have php installed?

if yes, look in the httpd.conf file for this line

LoadModule php4_module libexec/libphp4.so (or something simmilar)

if there is also line with &quot;ClearModuleList&quot;, you have to add after that line

AddModule mod_php4.c

and then restart apache
 
I had to add the lines, they were not originally in there. It still comes up and ask for me to open or save the file. When I open it, I get this line: <?=phpinfo()?>

What next? Thank you for your help. I appreciate your fast response. The secret to education lies in respecting the student. {Ralph Waldo Emerson}.
 
is the php module loaded? look in the apache log, if there is no error on loading the php module
maybe it's located in some other location, could be modules/libphp4.so instead of libexec/libphp4.so
 
Thanks. I have the phpinfo.php working now. My new problem is when I try to connect my database to the server it comes up &quot;cannot connect to database server&quot;

I have mysql started.

Other question. How do I get mysqladmin running so I can type in mysqladmin create catalog?? Thank you for you help. The secret to education lies in respecting the student. {Ralph Waldo Emerson}.
 
you are full of problems :)

that message does not appear to be a mysql error message
what exact error do you have?

try first &quot;mysqladmin version&quot;, if the output is something like this:

/usr/local/mysql/bin/mysqladmin Ver 8.18 Distrib 3.23.36, for pc-linux-gnu on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 3.23.36
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 26 days 1 hour 44 min 9 sec

Threads: 41 Questions: 104304515 Slow queries: 0 Opens: 258857 Flush tables: 5 Open tables: 64 Queries per second avg: 46.303

then you server is definitely running
 
Yes, I do have a lot of problems. I guess that is what happens when you are trying to teach yourself. Thank you for being patient.

Where do I type the mysqladmin version? I did it in the command prompt for mysql and nothing comes back, just a -> and a blank line.

I downloaded the oscommerce shopping cart which is open source. I copied the admin and catalog directories to my apache server htdocs like I was told by their site.

When I type in I get all the files listed. One of these files is shopping_cart.php

When I type in I get this error:

Unable to connect to database server! The secret to education lies in respecting the student. {Ralph Waldo Emerson}.
 
You'll need to edit the config file with th eshopping cart to allow it to access your database.

i.e add in your username and passwrd. ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
I know I am being a pain. There is no config.file to add my user name and password. It says it should be in the catalog/inculeds/local but it is not. Do i have to write one from scratch and put it in there? Thanks. The secret to education lies in respecting the student. {Ralph Waldo Emerson}.
 
dunno, where did you download from, I'll look at it and se what you need to do. ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
hi

open the shopping_cart.php file in your favourite editor and look for line with one of these commands

mysql_connect()

or

mysql_pconnect()

if you can't find it and there are some included files look in those too

then change the username and password there

 
You guys are great. I did not find anything in shopping_cart.php But I found something in application_top.php that files reference. I found this:

// define our database connection
define('DB_SERVER', 'exchange');
define('DB_SERVER_USERNAME', 'mysql');
define('DB_SERVER_PASSWORD', '');
define('DB_DATABASE', 'catalog');
define('USE_PCONNECT', 1);

When I put my username and password I get this from the browser:

Parse error: parse error, unexpected T_STRING in c:\Program Files\Apache Group\Apache\htdocs\catalog\includes\application_top.php on line 90

Warning: Failed opening 'DIR_WS_INCLUDESinclude_once.php' for inclusion (include_path='.;c:\php4\pear') in c:\Program Files\Apache Group\Apache\htdocs\catalog\shopping_cart.php on line 2

Fatal error: Call to undefined function: tep_href_link() in c:\Program Files\Apache Group\Apache\htdocs\catalog\shopping_cart.php on line 3

I am going to play with this somemore and see what I get. I think I understand some of the problems it is telling me. Any suggestions of course is welcomed. Again thanks for you help. The secret to education lies in respecting the student. {Ralph Waldo Emerson}.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top