Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mysql stöd in i php [fixad]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Scandinavian
View previous topic :: View next topic  
Author Message
soujirou
Apprentice
Apprentice


Joined: 22 Jun 2004
Posts: 205
Location: sweden

PostPosted: Fri Jun 25, 2004 10:49 am    Post subject: mysql stöd in i php [fixad] Reply with quote

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
View user's profile Send private message
aridhol
Guru
Guru


Joined: 20 Jan 2003
Posts: 509
Location: Stockholm, Sweden

PostPosted: Fri Jun 25, 2004 11:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
soujirou
Apprentice
Apprentice


Joined: 22 Jun 2004
Posts: 205
Location: sweden

PostPosted: Sat Jun 26, 2004 10:06 am    Post subject: Reply with quote

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
View user's profile Send private message
aridhol
Guru
Guru


Joined: 20 Jan 2003
Posts: 509
Location: Stockholm, Sweden

PostPosted: Sat Jun 26, 2004 10:38 am    Post subject: Reply with quote

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
View user's profile Send private message
soujirou
Apprentice
Apprentice


Joined: 22 Jun 2004
Posts: 205
Location: sweden

PostPosted: Sat Jun 26, 2004 11:22 am    Post subject: Reply with quote

så jag måste instalera om php ?
med detta som alternativ "--with-mysql" ?
Back to top
View user's profile Send private message
aridhol
Guru
Guru


Joined: 20 Jan 2003
Posts: 509
Location: Stockholm, Sweden

PostPosted: Sat Jun 26, 2004 11:27 am    Post subject: Reply with quote

Om du inte använt USEflaggan mysql så ja.

Om du installerade php så här
Code:
emerge php

så skriv
Code:
emerge -pv php

Om den då visar +mysql så har du med stor sannolikhet redan installerat med stöd för mysql.

Prova skapa en php-fil:
Code:
phpinfo()

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
View user's profile Send private message
soujirou
Apprentice
Apprentice


Joined: 22 Jun 2004
Posts: 205
Location: sweden

PostPosted: Sat Jun 26, 2004 11:58 am    Post subject: Reply with quote

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
View user's profile Send private message
aridhol
Guru
Guru


Joined: 20 Jan 2003
Posts: 509
Location: Stockholm, Sweden

PostPosted: Sat Jun 26, 2004 1:26 pm    Post subject: Reply with quote

Menade att test.php skulle su ut så här:

Code:
<?
phpinfo();
?>

_________________
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
View user's profile Send private message
soujirou
Apprentice
Apprentice


Joined: 22 Jun 2004
Posts: 205
Location: sweden

PostPosted: Sat Jun 26, 2004 3:45 pm    Post subject: Reply with quote

okej
hum det blev bara tomt =/
Back to top
View user's profile Send private message
meathoz
n00b
n00b


Joined: 18 Jan 2004
Posts: 61
Location: Finland

PostPosted: Sat Jun 26, 2004 4:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
soujirou
Apprentice
Apprentice


Joined: 22 Jun 2004
Posts: 205
Location: sweden

PostPosted: Sat Jun 26, 2004 4:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
aridhol
Guru
Guru


Joined: 20 Jan 2003
Posts: 509
Location: Stockholm, Sweden

PostPosted: Sat Jun 26, 2004 6:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Scandinavian All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum