LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Konqueror and phpMyAdmin--opens in Kwrite, won't display PHP (https://www.linuxquestions.org/questions/linux-software-2/konqueror-and-phpmyadmin-opens-in-kwrite-wont-display-php-103392/)

hindenbergbaby 10-13-2003 08:34 AM

Konqueror and phpMyAdmin--opens in Kwrite, won't display PHP
 
I am trying my damnedest to get phpMyAdmin to play nice with SOMETHING on my computer. I am running SuSE 8.2 and have Apache 2, PHP 4.3.3 and phpMyAdmin 2.4.0 installed. And of course, mySQL. I try to open phpMyAdmin with Konqueror, but I run into problems. First, it associated it with Kwrite, so I just got a screen full of source code. I tried to associate it with Konqueror, and now I get this message:

There appears to be a configuration error. You have associated Konqueror with text/x-c++src, but it can't handle this file type.

I also tried it with Opera, and I get some weird php output, not what it actually is supposed to be. I tried Galeon and Mozilla, too, just for the hell of it, and they give me the source code, just like Konqueror did originally (before I screwed it up, evidentally).

Any ideas what I'm doing wrong, and what I can do to get this working? Other php files (ones on the net) work okay... Keep in mind I am a complete newb. I tried searching here and Google, but alas, most people's comprehension seems a little more advanced than mine.

shoe

david_ross 10-13-2003 01:31 PM

If you ar egetting php output then it is likely to eb a server problem. Have you used php on that system before? Create a file called phpino.php and put it in the root of your web server
Code:

<?php
phpinfo();
?>

And access it via your webserver - do you get the code back or a list of installed php modules and a version number?

hindenbergbaby 10-13-2003 02:51 PM

Thanks for replying.

I was a little confused, so I created an actual php file (and got code back), which is what I think you meant.

I also queried info via the shell about php, and got this Status: 404
Content-type: text/html
X-Powered-BY: PHP/4.3.3

I'm not sure if that's helpful.


Here's the scoop: I don't intend on using this to do any database management on the web... I'm setting it up with the necessary files on my Linux desktop, mainly because I'm taking a database management class and I need it to do homework, not because I actually have ANY idea what I'm doing. So I installed all the parts and kind of hoped phpMyAdmin would fall into place. So please forgive me if I ask really stupid questions along the way here... I'm setting this up as localhost and going from there...

thanks again
shoe

david_ross 10-13-2003 02:55 PM

Check that you have php installed and that you have the required directives in httpd.conf. You should be ale to find these in the php documentation.

Just post if you run into problems.

hindenbergbaby 10-14-2003 01:52 PM

Hey David,

Sorry, didn't realize I posted it in another forum... must have been a couple days ago (between this and a VERY uncooperative application in Windows, I've been out straight in front of this freakin' computer), or I clicked something wrong or something...

I didn't see a loadmodule line... Honestly, I looked through httpd.conf, and googled, and saw that there should be a line that says something like AddType application/x-httpd-php, and that wasn't ANYWHERE to be seen. So I added it. I'm going to take another looksie, though. Didn't see a loadmodule line anywhere.

It looks like the more I google, the more confused I get.

shoe:confused:

david_ross 10-14-2003 02:10 PM

This is the document I was reffering to:
http://www.php.net/manual/en/install.apache2.php

hindenbergbaby 10-14-2003 02:21 PM

Okay, got it... Think I may have screwed up installation, so I'm trying to reconfigure. I'll let you know how it goes. Thanks!

shoe

hindenbergbaby 10-14-2003 03:20 PM

Okay. I got this error message after I configured and ran "make" again... I figured I'd not configured with mysql or --/usr/local/apache2 so I think that might have been half my problem...

In function 'php_stat': /php4-200310141930/ext/standard/filestat.c:575: undefined reference to 'php_check_open_basedir_ex'
collect2: ld returned one exit status
make: *** [sapi/cli/php] Error 1

Any clue as to what's going on?

shoe

david_ross 10-14-2003 03:36 PM

Did you do a "make distclean" prior to recompiling or did you use the sources from scratch again?

hindenbergbaby 10-14-2003 04:38 PM

good news bad news
 
Well, make distclean worked (that's a handy little command... I am PAINFULLY new at Linux. Never would have guessed, huh?). I got it installed again, and LoadModule actually showed up in my Apache conf file. I added what it said to add on that link you so kindly gave...

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source

Alas, everything is still opening as if my computer's never seen php before. I have tried fiddling with the settings in Opera, adding application/x-httpd-php to Mime Types, but still no luck.

Any suggestions?

shoe

alm 10-14-2003 06:48 PM

Try changing the name of your .html file to something with a .php ending,
or have you tried this already?

hindenbergbaby 10-14-2003 07:32 PM

Better news
 
After some playing, I got the phpinfo script to work (yeeha). However, I still can't get phpMyAdmin to work. Does it also need to be in the Apache htdocs dir? Or is there some other configuration I can use to get it to work? I haven't seen much about this.

shoe

hindenbergbaby 10-14-2003 08:08 PM

I moved phpMyAdmin and....Okay, I got phpMyAdmin to come up (the saga continues) but I get this error message:

phpMyAdmin - Error

phpMyAdmin was unable to read your configuration file!
This might happen if php finds a parse error in it or php cannot find the file.
Please call the configuration file directly using the link below and read the php error message(s) that you receive. In most cases a quote or a semicolon is missing somewhere.
If you receive a blank page, everything is fine.

config.inc.php

I look at the ever so descriptive config.inc.php, and discover that it's blank. I'm guessing that I have a link problem, but I'm not sure where. Actually, I'm not entirely sure what a parse error even is. My guess, however, is that php can't find the file. I'm assuming I link php.ini-recommended to something? Maybe? Bueller? Any suggestions will be entertained.

Thank everyone who's tried to help me. I must be driving you bats.

shoe

david_ross 10-15-2003 12:46 PM

The config file shoudln't be blank. Try downloading and unpacking again.

hindenbergbaby 10-15-2003 01:54 PM

I'm sorry, David, I was unclear with my description in what I reported earlier... I just read what I wrote again...

My config.inc.php has content... I get all the configuration settings and such. However, when I get the error message, it flashes a link to config.inc.php. If I click on the link, instead of getting an error message, I just get a blank document.

The error message on index.php says if that happens, everything is fine. However, it's pretty obvious that everything isn't if I'm still getting the error message. I'm going to play with the configuration a little more... I must have something set wrong somewhere, though I don't know whether it's with phpMyAdmin or somewhere else.

thanks
shoe

Edit: Does php need a link of some sort to be able to find phpMyAdmin? Perhaps that's it?

david_ross 10-15-2003 03:13 PM

php doesn't need a link to phpMyAdmin but the config file will need permissions so that the server can read the file and perhaps write to it (can't remember if it needs too)

hindenbergbaby 10-15-2003 03:55 PM

Please don't think I'm totally helpless, but... do I do that in php.ini or do I do that in phpMyAdmin config.inc.php? I looked in both and did some searching, but the only way I saw to change permissions is with chmod, or chown or one of the other ch commands. I'd like it so phpMyAdmin is usable as my user name, and of course as root.
Here's how config.inc.php is set now... From what I gather this is okay? (passwords deleted, of course)

// You can disable a server config entry by setting host to ''.
$i++;
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection
// (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser'] = 'root'; // MySQL control
user settings
// (this user must have read-only
$cfg['Servers'][$i]['controlpass'] = 'xxxxxx'; // access to
the
"mysql/user"
// and "mysql/db" tables)
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'myusername'; // MySQL user
$cfg['Servers'][$i]['password'] = 'xxxxxx'; // MySQL
password (only needed
// with 'config' auth_type)
*snip snip snip in interest of bandwith*

If it's php itself I'm screwing with, can I do it from the command line, or do I alter php.ini-recommended? Like I said, I checked stuff out and didn't see it mentioned, so I don't want to mess with it...

Thanks (and sorry)

shoe

hindenbergbaby 10-15-2003 05:11 PM

FIGURED IT OUT! (you won't believe this)
 
I found an error log, finally, after much weeping, wailing, and gnashing of teeth. Here's what it was: It looks like, somewhere in the translation, the comments in the code in config.inc.php that basically tell the user what to do, got somehow read as commands. Once I had the line numbers with the problems in it in front of me it was fairly easy to figure out.

I DID notice, afterwards, that my log ins were wrong, so it wouldn't let me in mySQL. So I did a search and managed to fix that... Yeeeha.

Thanks, David, for all your help. One final question: I don't plan on using this box as a server... ever... but of course, now I have apache. Is it safe to leave apache running all the time if I'm not using it as a server? Does it compromise security at all?

shoe

david_ross 10-16-2003 01:20 PM

Leaving any service open is likely to degrade security slightly but if you are only accessing the server from the machine itself then you could set apache up to only listen to the loopback address 127.0.0.1
Just change the listen line to:
Listen 127.0.0.1:80

Gill Bates 10-16-2003 02:37 PM

look in the main php file too, there is some variable values that u need to fill in manually (just paths and stuff)

imagineers7 06-27-2006 11:27 PM

Hi all,

Thanks guys I think it will work for me too.

Thanks David, hindenbergbaby


All times are GMT -5. The time now is 03:47 PM.