I have installed both PHP(apache) and Mysql to the linux and they are running just fine but they dont work for the browser.

What could be wrong? I have made some PHP and mysql stuff and have tested them in "real" working server! But in my server they are just blank and shows empty files only thing is html tags.

Rgrds

    Did you install the php-mysql *.so file ??

    The file is mysql.so and allows php to talk to mysql...??? Just a thought.

      are you accessing them by opening the file, or by typing http://localhost/path-to-php-file?

      You can't just open .php files with a browser and have them work, they must be parsed through the server.

      moonie 😉

        Also, remember to check your apache's "httpd.conf" file ... make sure the following line is uncommented 😉

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

        • remember restart apache after modifying the httpd.conf file.

          Does't the mysql.so file installed in the mysql install process???

          Im accessing the files trough server and just a PHP is working!! But not whit mysql commands...

          I'l try to uncomment the line!

            Nope.... Some systems it might tell you about the fact that you need the mysql.so file to allow php and mysql to talk together (like Debian 🙂 ), but you need the .so file to allow them to talk together. Want to know if installed for shure???

            its under

            /usr/lib/php4/extensions/no-debug-non-zts-20001222/mysql.so

            under my system, but just look under the /usr/lib/php4/extensions/ and look for it. I have almost always had to specify this as a seperate download. Just cause you install mysql doesnt mean that you have the .so file! And Uncommenting the line will do nothing if you dont have the file. (And since its commented out I would assume you dont have it)

            Hope that helps.

              Should i uncomment the hole syntax of "if":
              #<ifModule mod_php.c>

              AddType application/x-httpd-php .phtml

              #</ifModule>

              And what it will do if it's uncommented?

                I was trying to locate the mysql.so file and i did'nt find it!!

                So how i can get it to the Linux. Or from where and trough that can u tell me how i can install or download the file/s? Some syntax or something!!

                I'm using the Linux for 20 days for now 🙂)!

                P.S. Thank u all who has responded to my question!

                  What version of linux do ya run??? If you run Redhat you can just download the rpm at

                  http://rpmfind.net/linux/rpm2html/search.php?query=mysql.so

                  and if you run debian its just a simple

                  apt-get install php-mysql

                  I couldnt find (I searched for all of 5min 🙂 sorry kinda busy) just the raw .so file. I know that you could recompile php with mysql support.

                  Another option if it is slackware, I dont know if there is an equivalent type of program for slackware, but I know that there is a program called alien
                  http://freshmeat.net/projects/alien/

                  which can convert rpms into tar tar files I think, which would be good 🙂.

                  Hope that helps!

                    Then thats easy just install the rpm that I talked about... its will automatically install the mysql.so for you...

                    The only reason I said slackware, was cause you had a slackware link on under where you found the mysql file. If you install the rpm buy the way I think it might uncomment that line for ya... but if not just make sure you have an extension like

                    extension=mysql.so

                    Good Luck!

                      Hi,

                      My httpd.conf file goes something like this:

                      :

                      LoadModule php4_module libexec/libphp4.so
                      :
                      AddModule mod_php4.c

                      <IfModule mod_mime.c>
                      :
                      AddType application/x-httpd-php .php .phtml
                      :
                      </IfModule>

                      Uncommenting "AddType application/x-httpd-php" basically tells apache that any files that ends with .php & .phtml (as in the example above) should be treated as php scripts, ie to be parsed by the php engine. (note: if you add ".inc" in that line, then any file ending with ".inc" will be treated as 'php files' too.

                      Hope that helps.

                        Well i got it work!! Problem was that the Apache was using a wrong modul!
                        I commented out the line:
                        #<ifDefine HAVE_PHP>
                        #LoadModule php_module modules/mod_php.so
                        #</ifDefine>

                        now its using the modules/libphp4.so!! Like it should use it from a start!

                        So thank you all who wasted a time for me
                        ;-)

                          Write a Reply...