Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am running Fedora Core 1 and using the version of Apache that it installs (2.0.47), and have installed MySQL 4.0.18-standard from an RPM.
I am preparing to install PHP 4.3.6 from source but have some questions.
My understanding is that I want to install PHP as an Apache DSO. In order to do that, I need to configure PHP using the option
--with-apxs=/path/to/apxs.
The problem is that I don't seem to have apxs. If I understand correctly, apxs is included with the development version of Apache, and that is not the one that is installed by FC1 installation. Is there some other way to get this script? I have searched high and low and cannot seem to find it.
Secondly, I want to--of course--enable MySQL support. I tried this on another box (and it didn't go too well). When I tried
./configure --with-mysql=/usr/bin
it complained that it could not locate the mysql header files. Now this makes sense that I do not have the header files, since I installed MySQL from an rpm and not from source. But I have a source that states that "If you do not specify a directory, the bundled MySQL library will be used." (http://hotwired.lycos.com/webmonkey/...tw=programming) So would my line be ./configure --with-mysql, or would I leave out --with-mysql altogether?
To sum up my question, how can I install PHP as an Apache DSO without reinstalling Apache from source, and include MySQL support when I installed it from an rpm?
Hi, thanks for the response. Here is what I get from the configure script:
Code:
+--------------------------------------------------------------------+
| *** WARNING *** |
| |
| You will be compiling the CGI version of PHP without any |
| redirection checking. By putting this cgi binary somewhere in |
| your web space, users may be able to circumvent existing .htaccess |
| security by loading files directly through the parser. See |
| http://www.php.net/manual/security.php for more details. |
+--------------------------------------------------------------------+
So this means that it will not be running as a DSO, correct? Does that mean that Apache was previously compiled without DSO supprt, or does it mean that I need to include the --with-apxs option?
I am using Apache 2, but I have neither apxs nor apxs2. I read somewhere that apxs comes with a developer installation of Apache (?) and that is apparently not what is installed with Fedora Core 1. At any rate, I don't have it and can't seem to find how to get it. I'm not really interested in this point at reinstalling Apache from source if there is *any* other way.
Thanks for all your help, really. I love this forum!
Initially I did have PHP installed from Fedora. What set me off on this path was when I started my first web app on this box using PHP. I had this line:
and I got some error about "call to unknown function" or some such. For whatever reason, PHP installed without MySQL support.
So I'm thinking that the Fedora PHP rpm wouldn't be the solution. While installing Apache from source is no big deal, I was unable to do it in such a way that everything works the way it does in a "normal" install. I have run through this whole process before on another box, and while I believe I have it working (finally), there are a number of problems, all of them dealing with the way I installed Apache. Apache no longer starts automatically on a reboot; /etc/init.d/httpd is gone; the conf file is not where I am accustomed to having it (now in /usr/local/apache/bin/httpd.conf or some such) and so forth.
Perhaps there is another rpm somewhere that would install PHP with MySQL support? That sounds like the ticket...What do you think?
Hmmm well from my experience Red Hat compiles their PHP RPM with just about everything bundled with it - certainly with MySQL support. I think the easiest option would be to install the Apache, PHP and MySQL RPMs from your Fedora CD and try debugging that setup.
OK, reinstalled PHP with the Fedora rpm. I am now back to this error:
Fatal error: Call to undefined function: mysql_connect() in /var/www/html/index.php on line 8.
Now, looking through the output from phpinfo(), I see this in the section on configure command:
--with-mysql=shared, /usr
Further, the section dbx lists supported databases, and MySQL is the first in the list. So it seems that PHP supports MySQL, but for some reason is not recognizing the mysql functions.
One more thing, also in the phpinfo() output in the section on the configure command is this:
--with-apxs2=/usr/sbin/apxs
As I mentioned earlier in the thread, I was unable to find apxs on my machine, and it is not in /usr/sbin unless it is hidden or something.
If the line above was successful, then PHP would have compiled as a DSO, and then I would need a LoadModule directive in httpd.conf in order for PHP to work (as I understand it). The directive is not there, and PHP is working (just doesn't recognize mysql functions), so it must not be a DSO?
No it would be a DSO. The fact that you can't find the apxs2 file doesn't matter. As long as it's there when PHP compiles (which is taken care of by Red Hat) then it's fine. Your error seems kind of strange. As you can imagine the Fedora RPM's are designed to play well with each other, so I'm surprised it doesn't work by default.
After doing a bit of research it looks like you need to install an RPM called php-mysql (http://www.redhat.com/archives/fedor.../msg00439.html). For Fedora core 1 it will probably be php-mysql-4.3.3-6.i386.rpm or something. Remember to service httpd restart after installing it.
If you have in fact already installed this RPM then I think I'm out of ideas!
Turns out that libmysqlclient.so10 comes with an older version of MySQL (3.something). So I had to install the shared libraries from MySQL-shared libraries. Fair enough:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.