View previous topic :: View next topic |
Author |
Message |
soujirou Apprentice
Joined: 22 Jun 2004 Posts: 205 Location: sweden
|
Posted: Fri Jun 25, 2004 10:49 am Post subject: mysql stöd in i php [fixad] |
|
|
nån som kan säga lite enkelt om hur man fixar länken med mysql till php tack!!
Last edited by soujirou on Sat Jun 26, 2004 6:26 pm; edited 1 time in total |
|
Back to top |
|
|
aridhol Guru
Joined: 20 Jan 2003 Posts: 509 Location: Stockholm, Sweden
|
Posted: Fri Jun 25, 2004 11:55 pm Post subject: |
|
|
Det handlar egentligen inte om att länka samman PHP och MySQL. Det handlar om att i PHP anropa MySQL. Det gör du genom att använda de kommandon som är MySQL specifika i PHP.
Läs mer här:
http://se.php.net/manual/en/ref.mysql.php _________________ 72 of Pitcairn Islands 49 inhabitants use Seti@Home
"If you buy a DVD you have a copy. If you want a backup copy you buy another one."
"Anyone who is capable of getting themselves made President should on no account be allowed to do the job." |
|
Back to top |
|
|
soujirou Apprentice
Joined: 22 Jun 2004 Posts: 205 Location: sweden
|
Posted: Sat Jun 26, 2004 10:06 am Post subject: |
|
|
okej tack.. men jag är kass jag vet.. det står inte vart man ska adda detta "--with-mysql=/path/to/mysql" i vilken fil ???? nån php fil ?
se vad är pathen till mysql ??
jag är n00b jag vet =) |
|
Back to top |
|
|
aridhol Guru
Joined: 20 Jan 2003 Posts: 509 Location: Stockholm, Sweden
|
Posted: Sat Jun 26, 2004 10:38 am Post subject: |
|
|
Ingen fara
Som sagt, det handlar inte om att binda samman mysql och php. Det gör du ju när du installerar php
Om du installerar php med USE-flaggan mysql så kommer stödet att finnas. _________________ 72 of Pitcairn Islands 49 inhabitants use Seti@Home
"If you buy a DVD you have a copy. If you want a backup copy you buy another one."
"Anyone who is capable of getting themselves made President should on no account be allowed to do the job." |
|
Back to top |
|
|
soujirou Apprentice
Joined: 22 Jun 2004 Posts: 205 Location: sweden
|
Posted: Sat Jun 26, 2004 11:22 am Post subject: |
|
|
så jag måste instalera om php ?
med detta som alternativ "--with-mysql" ? |
|
Back to top |
|
|
aridhol Guru
Joined: 20 Jan 2003 Posts: 509 Location: Stockholm, Sweden
|
Posted: Sat Jun 26, 2004 11:27 am Post subject: |
|
|
Om du inte använt USEflaggan mysql så ja.
Om du installerade php så här
så skriv
Om den då visar +mysql så har du med stor sannolikhet redan installerat med stöd för mysql.
Prova skapa en php-fil:
och kör den. Du kan då se om du har installerat med mysql-stöd redan. Om du inte har det så gör det genom att skriva
Code: | USE="mysql" emerge php |
_________________ 72 of Pitcairn Islands 49 inhabitants use Seti@Home
"If you buy a DVD you have a copy. If you want a backup copy you buy another one."
"Anyone who is capable of getting themselves made President should on no account be allowed to do the job." |
|
Back to top |
|
|
soujirou Apprentice
Joined: 22 Jun 2004 Posts: 205 Location: sweden
|
Posted: Sat Jun 26, 2004 11:58 am Post subject: |
|
|
tjo igen...
jag gjorde en test.php med innehållet phpinfo()
sen öppnade jag den i mozilla och jag såg bara phpinfo()
jag såg att +mysql fanns med var röd markerat
körde även USE="mysql" emerge php utan resultat efter -_-
det är så att jag får igång phpsysinfo men inte phpmyadmin |
|
Back to top |
|
|
aridhol Guru
Joined: 20 Jan 2003 Posts: 509 Location: Stockholm, Sweden
|
Posted: Sat Jun 26, 2004 1:26 pm Post subject: |
|
|
Menade att test.php skulle su ut så här:
_________________ 72 of Pitcairn Islands 49 inhabitants use Seti@Home
"If you buy a DVD you have a copy. If you want a backup copy you buy another one."
"Anyone who is capable of getting themselves made President should on no account be allowed to do the job." |
|
Back to top |
|
|
soujirou Apprentice
Joined: 22 Jun 2004 Posts: 205 Location: sweden
|
Posted: Sat Jun 26, 2004 3:45 pm Post subject: |
|
|
okej
hum det blev bara tomt =/ |
|
Back to top |
|
|
meathoz n00b
Joined: 18 Jan 2004 Posts: 61 Location: Finland
|
Posted: Sat Jun 26, 2004 4:16 pm Post subject: |
|
|
soujirou wrote: | okej
hum det blev bara tomt =/ |
tomt?
vad händer om du skapar en php-fil som innehåller tex.
Code: |
<?php
echo "hej!";
?>
|
Det normala är nämligen att du inte ser 'hej' utan 'echo "hej;"' om du inte har konfigurerat apache för php. Det gör du i /etc/conf.d/apache2 genom att ändra den sista raden till
Code: | APACHE2_OPTS="-D SSL -D PHP4" |
|
|
Back to top |
|
|
soujirou Apprentice
Joined: 22 Jun 2004 Posts: 205 Location: sweden
|
Posted: Sat Jun 26, 2004 4:31 pm Post subject: |
|
|
blev tomt det med =(
jo asså php måste funka för att jag kan köra phpsysinfo utan problem
men pgpmyadmin vägrar.. pga av mysql grejjen |
|
Back to top |
|
|
aridhol Guru
Joined: 20 Jan 2003 Posts: 509 Location: Stockholm, Sweden
|
Posted: Sat Jun 26, 2004 6:23 pm Post subject: |
|
|
Efter att ha testat lite via IRC fann vi att problemet var att phpmyadmin, som visade fel i kopplingen till mysql, inte var färdiginstallerat.
Vad som behövdes var alltså
Code: | ebuild /var/db/path/to/ebuild config
/etc/init.d/mysql restart |
Om du kan skriva [Fixat] i titeln nu skulle det vara perfekt. _________________ 72 of Pitcairn Islands 49 inhabitants use Seti@Home
"If you buy a DVD you have a copy. If you want a backup copy you buy another one."
"Anyone who is capable of getting themselves made President should on no account be allowed to do the job." |
|
Back to top |
|
|
|