php5 +apache2 +mysql5 does not behave as expected
At the end of a MAMP installation (sudo port install php5 +apache2 +mysql5) I got the following message: ---> Installing php5 5.2.1_1+apache2+darwin_8+macosx+mysql5 If this is your first install, you might want cd /opt/local/apache2/modules /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so * copy /opt/local/etc/php.ini-dist to /opt/local/etc/php.ini ---> Activating php5 5.2.1_1+apache2+darwin_8+macosx+mysql5 ---> Cleaning php5 Question: what is it exactly that I might want to do? Should I copy those lines from cd ... ini into my terminal? As one line, three lines? Does this have anything to do with the fact that the installation did not result in a proper httpd.conf, as I expected, but in a file called httpd.conf.sample which, among other things, has no LoadModule for php5? I did a port install for apache2 and mysql5 (and subversion) before I did the port install php5 +apache2 +mysql5 Elise van Looij
On Mar 17, 2007, at 2:45 PM, Elise van Looij wrote:
cd /opt/local/apache2/modules /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so * copy /opt/local/etc/php.ini-dist to /opt/local/etc/php.ini
Question: what is it exactly that I might want to do? Should I copy those lines from cd ... ini into my terminal? As one line, three lines?
as three lines, ready for pasting, it looks like this: cd /opt/local/apache2/modules && /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so; \ cp /opt/local/etc/php.ini-dist /opt/local/etc/php.ini Regards, Elias Pipping
Elise van Looij <evlooij@xs4all.nl> on Saturday, March 17, 2007 at 5:45 AM -0800 wrote:
Does this have anything to do with the fact that the installation did not result in a proper httpd.conf, as I expected, but in a file called httpd.conf.sample which, among other things, has no LoadModule for php5?
The creation of httpd.conf.sample alone is intentional. If the real file were installed, then upgrades to php5 would wipe out any modifications you put in the file and replace it with the sample, and this is undesireable behavior. Mark
I've noticed that httpd-dav.conf and httpd-ssl.conf in the conf/extra folder do get over-written in an upgrade but httpd.conf is safe. John Korchok
-----Original Message----- From: macports-users-bounces@lists.macosforge.org [mailto:macports-users-bounces@lists.macosforge.org] On Behalf Of Mark Duling Sent: Saturday, March 17, 2007 11:27 AM To: Elise van Looij Cc: macports-users@lists.macosforge.org Subject: Re: php5 +apache2 +mysql5 does not behave as expected
Elise van Looij <evlooij@xs4all.nl> on Saturday, March 17, 2007 at 5:45 AM -0800 wrote:
Does this have anything to do with the fact that the installation did not result in a proper httpd.conf, as I expected, but in a file called httpd.conf.sample which, among other things, has no LoadModule for php5?
The creation of httpd.conf.sample alone is intentional. If the real file were installed, then upgrades to php5 would wipe out any modifications you put in the file and replace it with the sample, and this is undesireable behavior.
Mark
_______________________________________________ macports-users mailing list macports-users@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/macports-users
On Mar 17, 2007, at 08:45, Elise van Looij wrote:
At the end of a MAMP installation (sudo port install php5 +apache2 +mysql5) I got the following message:
---> Installing php5 5.2.1_1+apache2+darwin_8+macosx+mysql5
If this is your first install, you might want cd /opt/local/apache2/modules /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so
* copy /opt/local/etc/php.ini-dist to /opt/local/etc/php.ini ---> Activating php5 5.2.1_1+apache2+darwin_8+macosx+mysql5 ---> Cleaning php5
Question: what is it exactly that I might want to do? Should I copy those lines from cd ... ini into my terminal? As one line, three lines?
You can copy and paste the two lines into your Terminal exactly as they appear: cd /opt/local/apache2/modules /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so This should activate the php5 module. It's further suggesting that you may want to copy php.ini-dist to php.ini in /opt/local/etc, as a start for your PHP configuration.
Does this have anything to do with the fact that the installation did not result in a proper httpd.conf, as I expected, but in a file called httpd.conf.sample which, among other things, has no LoadModule for php5?
The apache2 port creates the httpd.conf.sample. You can copy this to httpd.conf as a basis for your Apache configuration. If it doesn't contain a LoadModule line for the php5 port after you run the apxs command above, then add one that reads like this: LoadModule php5_module modules/libphp5.so You'll probably also want this, if you don't have it already: <IfModule dir_module> DirectoryIndex index.php index.html </IfModule> And this, at the end of the <IfModule mime_module> section: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps That should be all you need. The instructions printed by the php5 port at the end may need to be updated. Patches to the portfile are welcome.
Thank you very much to all who responded, and especially Ryan for his patience. Once I got my httpd.conf in proper shape, php worked fine, but mysql didn't. The problem was: error: 'Can't connect to local MySQL server through socket '/opt/ local/var/run/mysql5/mysqld.sock' This was a problem others had wrestled with as well, I soon found out. It turned out I'd made two mistakes when installing mysql: I hadn't used the +server variant and I hadn't initialized the database. So I uninstalled php5 and mysql5, reinstalled mysql5 +server and followed the instructions in an old post by Ryan Schmidt on how install the main db: http://article.gmane.org/gmane.os.apple.macports.user/619/match=mysql I then reinstalled php5 +apache2 +mysql5 and now they're all nice to each other once again. Elise van Looij
Elise van Looij <evlooij@xs4all.nl> on Thursday, March 22, 2007 at 8:49 AM -0800 wrote:
Thank you very much to all who responded, and especially Ryan for his patience. Once I got my httpd.conf in proper shape, php worked fine, but mysql didn't. The problem was:
error: 'Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock'
This was a problem others had wrestled with as well, I soon found out. It turned out I'd made two mistakes when installing mysql: I hadn't used the +server variant and I hadn't initialized the database. So I uninstalled php5 and mysql5, reinstalled mysql5 +server and followed the instructions in an old post by Ryan Schmidt on how install the main db: [ http://article.gmane.org/gmane.os.apple.macports.user/619/match=mysql ]http://article.gmane.org/gmane.os.apple.macports.user/619/match=mysql
I then reinstalled php5 +apache2 +mysql5 and now they're all nice to each other once again.
There are some hacks to for port authors to prevent this behavior I've discovered. I'd be interested to hear if there is a downside to this. But if you'd make an empty server variant for the php5 port (variant server {}), and within the mysql5 variant use "variant_set server", then I think that "port installed php5 +apache2 +mysql5" would install mysql as a dependent using the server variant. This is because when a port is installed with a variant named "foo", all dependents that have variants named "foo" are installed using the variant. Mark
On Mar 22, 2007, at 1:34 PM, Mark Duling wrote:
This is because when a port is installed with a variant named "foo", all dependents that have variants named "foo" are installed using the variant.
Have you tested this recently? I think it may have broken sometime semi-recently (as a bunch of people have reported to me that they had to install apr-util with the +no_bdb variant even though they should have been able to just install subversion with +no_bdb and had it pass the variant on ...) -- Daniel J. Luke +========================================================+ | *---------------- dluke@geeklair.net ----------------* | | *-------------- http://www.geeklair.net -------------* | +========================================================+ | Opinions expressed are mine and do not necessarily | | reflect the opinions of my employer. | +========================================================+
"Daniel J. Luke" <dluke@geeklair.net> on Thursday, March 22, 2007 at 9:41 AM -0800 wrote:
This is because when a port is installed with a variant named "foo", all dependents that have variants named "foo" are installed using the variant.
Have you tested this recently?
I think it may have broken sometime semi-recently (as a bunch of people have reported to me that they had to install apr-util with the +no_bdb variant even though they should have been able to just install subversion with +no_bdb and had it pass the variant on ...)
Yes it works for me, but I'm still on MP 1.3.2. Do you think it is failing on 1.4? Mark
On Mar 22, 2007, at 1:48 PM, Mark Duling wrote:
Have you tested this recently?
I think it may have broken sometime semi-recently (as a bunch of people have reported to me that they had to install apr-util with the +no_bdb variant even though they should have been able to just install subversion with +no_bdb and had it pass the variant on ...)
Yes it works for me, but I'm still on MP 1.3.2. Do you think it is failing on 1.4?
I'm not sure, I'll have to do some testing (I haven't been asking people who've reported the problem if they're running the pre-release version, which in retrospect is kind of dumb of me). -- Daniel J. Luke +========================================================+ | *---------------- dluke@geeklair.net ----------------* | | *-------------- http://www.geeklair.net -------------* | +========================================================+ | Opinions expressed are mine and do not necessarily | | reflect the opinions of my employer. | +========================================================+
On Mar 22, 2007, at 14:36, Daniel J. Luke wrote:
Have you tested this recently?
I think it may have broken sometime semi-recently (as a bunch of people have reported to me that they had to install apr-util with the +no_bdb variant even though they should have been able to just install subversion with +no_bdb and had it pass the variant on ...)
Yes it works for me, but I'm still on MP 1.3.2. Do you think it is failing on 1.4?
I'm not sure, I'll have to do some testing (I haven't been asking people who've reported the problem if they're running the pre- release version, which in retrospect is kind of dumb of me).
When I reported the problem with Subversion, I was running MacPorts 1.3.2. The problem was that "sudo port install subversion +no_bdb" would still download db44, because db44 is a dependency of apr-util, and apr-util is a dependency of subversion. It would install db44, and apr-util +no_bdb, and subversion +no_bdb. When all was done, I could "sudo port uninstall db44". But I never wanted db44 to be downloaded and installed in the first place.
On Mar 22, 2007, at 12:34, Mark Duling wrote:
On Thursday, March 22, 2007 at 8:49 AM, Elise van Looij wrote:
turned out I'd made two mistakes when installing mysql: I hadn't used the +server variant and I hadn't initialized the database. So I uninstalled php5 and mysql5, reinstalled mysql5 +server and followed the instructions in an old post by Ryan Schmidt on how install the main db:
[snip]
There are some hacks to for port authors to prevent this behavior I've discovered. I'd be interested to hear if there is a downside to this. But if you'd make an empty server variant for the php5 port (variant server {}), and within the mysql5 variant use "variant_set server", then I think that "port installed php5 +apache2 +mysql5" would install mysql as a dependent using the server variant. This is because when a port is installed with a variant named "foo", all dependents that have variants named "foo" are installed using the variant.
Rather than litter the php5 port with variants that do not relate to it, I would prefer that the mysql5 +server variant be moved to a new mysql5-server port, which would depend on the mysql5 port. php5 would continue to depend on the mysql5 port, not the mysql5-server port, since php5 does not require there to be a mysql5 server, but those who then discover that they want to run a mysql5 server can simply install the mysql5-server port which will be much quicker for them than uninstalling and recompiling all of mysql5. See the postgresql82- server port for an example.
Op 22-mrt-2007, om 18:34 heeft Mark Duling het volgende geschreven:
This was a problem others had wrestled with as well, I soon found out. It turned out I'd made two mistakes when installing mysql: I hadn't used the +server variant and I hadn't initialized the database. So I uninstalled php5 and mysql5, reinstalled mysql5 +server and followed the instructions in an old post by Ryan Schmidt on how install the main db: [ http://article.gmane.org/gmane.os.apple.macports.user/619/ match=mysql ]http://article.gmane.org/gmane.os.apple.macports.user/619/ match=mysql
I then reinstalled php5 +apache2 +mysql5 and now they're all nice to each other once again.
There are some hacks to for port authors to prevent this behavior I've discovered. I'd be interested to hear if there is a downside to this.
I'm not sure whether this is what you're referring too, but I did run into one problem. Setting the root password as recommended by the installation script worked fine with: /opt/local/lib/mysql5/bin/mysqladmin -u root password 'myBrandNewPassword' But failed on: /opt/local/lib/mysql5/bin/mysqladmin -u root -h MyComputerName.local password 'myBrandNewPassword' /opt/local/lib/mysql5/bin/mysqladmin: connect to server at 'MyComputerName.local' failed error: 'Host '10.0.0.167' is not allowed to connect to this MySQL server' I didn't think much of it at the time but when I installed phpMyAdmin the other day, I soon ran into major problems with user privileges, the upshot of which was that all of my root accounts were somehow stripped of their privileges and I had to reinstall the whole thing once again. Googling revealed that the ' Host '10.0.0.167' is not allowed' was a common error in mysql 4.x which was fixed in an upgrade. Nobody has reported it with MySQL5. Does this have anything to do with the fact that I installed MySQL5 with the server variant on a regular, non- server MacOS 10.4 system? Elise van Looij
participants (6)
-
Daniel J. Luke
-
Elias Pipping
-
Elise van Looij
-
John Korchok
-
Mark Duling
-
Ryan Schmidt