Re: Trouble connecting virtual host to MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




------------ Original Message ------------
> Date: Saturday, April 09, 2016 16:22:51 +0200
> From: Roparzh Hemon <roparzhhemon@xxxxxxxxx>
>
> On Sat, Apr 9, 2016 at 3:50 PM, Richard wrote:
>> 
>> 
>> You are (likely) getting to two different places with these
>> requests.
>> 
> 
>   That's not what is happening IMHO, see below. Let me repeat
> that the problem only appears when I use MySQL.
> 
>> The url: <http://www.localmicael.com> is getting you to
>> "Mikeal/public_html", while [<http://]localhost:8888/Mikeal> is
>> probably getting you to the level above.
> 
>  I can type any of
> [http://]localhost:8888/Mikeal[/public_html][/index.php], all those
> will make my browser correctly serve the index.php file located
> precisely at
> /Users/myusernamehere/Documents/Sites/Mikeal/public_html/index.php
> 
>   Also, shouldn't <http://www.localmicael.com> lead to
> this very same file, according to what I specified in
> /private/etc/apache2/extra/httpd-vhosts.conf (see first post) ?
> 
>> Exactly what is going on is
>> somewhat obscured because you don't show the configuration for your
>> server at ":8888".
> 
>    This 8888 port is used by the MAMP application on my Mac, and is
> nowhere mentioned in the Apache conf files I edited. Do you advise
> me to post here the lengthy output of MAMP's start page or its even
> lengthier phpinfo output ? Are there specific parameters you think
> might be revelant ?
> 
>> is "Mikeal/public_html" a directory or a
>> file? It should be a directory.
> 
> It is a  directory indeed.
> 
> 
>> you seem to have two virtual hosts configured (one at :80 and
>> one at :8888) and the php files have different references for
>> mysql.
> 
>  I naturally thought of modifying a $db_port parameter in my PHP
> code, setting it to 80 or 8888 or some other random value, but the
> problem stayed exactly the same : the page displays correctly if I
> use that 8888 port (i.e. using my MAMP server), but fails if I try
> to use Apache directly.
> 

Ok, lets go with your more complete information.

The "$db_port" that you have in your php code is the mysql port, and
is unrelated to the httpd port. By default, mysql listens on 3306
(and  80 and 8888 are already being used by httpd instances). 

I would suggest carefully comparing the output from phpinfo() from
both your :80 and :888 instances and see if/where the differences
are. I'd start with the php.ini that is being read - make certain the
same one is being used. Then look closely at the mysql section(s) --
e.g., the socket location as well as the port. You should also,
likely, be able to get additional information from the apache error
log for your virtual host.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux