LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Strange PHP problems with Apache (https://www.linuxquestions.org/questions/linux-software-2/strange-php-problems-with-apache-49059/)

trollatm 03-10-2003 12:24 AM

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!

peter_robb 03-10-2003 06:56 AM

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

trollatm 03-10-2003 02:36 PM

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.

peter_robb 03-10-2003 03:11 PM

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?

trollatm 03-11-2003 01:20 AM

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???


All times are GMT -5. The time now is 07:29 AM.