LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-10-2003, 12:24 AM   #1
trollatm
LQ Newbie
 
Registered: Oct 2002
Location: NJ, USA
Distribution: Slackaware
Posts: 8

Rep: Reputation: 0
Strange PHP problems with Apache


I am trying to set up some stuff for my site and want to start using php and sql. So I have Apache and mysql installed (pre-installed from the distro). Apache works, SQL works (I have an SQL based forum running) but when I tried to write my own script and saved it with a .php extension and go to it on my site nothing happens, no sql error, no page not found error, nothing. When I save it with the extension .php4(for s#!ts and giggles) the page will load but the php scripts don't run. I am almost certain the php mod is loaded and in the php mod config I have the line "AddType application/x-httpd-php .php" Is there something I missed? Much appreciative. THANKS!
 
Old 03-10-2003, 06:56 AM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
php, php3 & php4 are different... of course...
I have...
AddType application/x-httpd-php .php4 .php3 .phtml .php
& LoadModule php4_module modules/libphp4.so
& AddModule mod_php4.c
 
Old 03-10-2003, 02:36 PM   #3
trollatm
LQ Newbie
 
Registered: Oct 2002
Location: NJ, USA
Distribution: Slackaware
Posts: 8

Original Poster
Rep: Reputation: 0
I added the lines and now the files with the .php4 dont work at all, just like the .php. So I can assume something is wrong with my script or php. I tried the script <?PHP phpinfo(); ?> and that works so I guess its my script? I will try a few things and report back later.
 
Old 03-10-2003, 03:11 PM   #4
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
If you're writing under PHP4, make sure you save the script as *.php4.

I have also commented out any Module references to .php & php3.
Quote from httpd.conf...
<IfModule mod_php4.c>
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>
<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
</IfModule>
<IfModule mod_php.c>
AddType application/x-httpd-php .phtml
</IfModule>

Do you have these as well?
 
Old 03-11-2003, 01:20 AM   #5
trollatm
LQ Newbie
 
Registered: Oct 2002
Location: NJ, USA
Distribution: Slackaware
Posts: 8

Original Poster
Rep: Reputation: 0
I've narrowed it down to when I create a variable. I can connect to the database "mysql_connect("server","username","password");" and I can select the database "mysql_select_db("whatever");" and I can do and echo out "echo "blah blah blah";" but as soon as I do a : "$whatever = mysql_query("select * from whatever")" the script wont run at all. Even early basic echos early in the script wont work.... I don't get it. Any ideas???
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
strange apache php problem lbharti Linux - Software 3 05-20-2005 10:39 AM
Apache 1.3.33 + PHP 5.02 problems... NuTBoMbS Linux - Software 1 11-09-2004 01:36 AM
slackware, apache and PHP from .tgz - problems with PHP szymon Slackware 2 09-06-2004 04:57 PM
Apache and Php problems myguest Linux - Software 6 06-11-2004 09:28 AM
php + apache problems nocturnal Linux - Software 1 07-02-2003 07:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration