Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Problem z polaczeniem
Forum PHP.pl > Forum > PHP > Object-oriented programming
Zelek
Witam serdecznie wszystkich uzytkownikow tego forum

Jako ze jestem tu nowym, to moze najpierw sie przedstawie
Jestem Maciej z Warszawy, jestem tu nowy i malo sie zanam na PHPe i MySQLu
lecz ze wzgledu iz mam do wykonania prace inzynierska w PHPie i MySQLu zwracam sie o pomoc

Mam pewien problem:
zainstalowalem PHPa 5.0.4, MySQLa 4.1.9 i Apacha 2.0.54
problem jest taki ze nie moge sie polaczyc z baza danych za pomoca PHPa, z tego co mi wiadomo to trzeba wlaczyc support MySQLa dla PHPa i wlasnie nie wiem jak tego dokonac.
W pliku php.ini zmienilem sciezki
include_path = ".;C:\Program Files\Apache Group\Apache2\include"

doc_root = "C:\Program Files\Apache Group\Apache2\htdocs"

extension_dir = "C:\php\ext"

generalnie to chyba mi chodzi o wlaczenie supportu mysqla dla phpa czy cos takiego

czy ktos sie moze spotkal z tym problemem ? a tak btw to jak to juz gdzies bylo opisane poprostu podajcie linka zeby nie zasmiecac forum.

Z gory dziekuje
Zelek
kszychu
Cytat(Zelek @ 2005-10-26 14:37:21)
poprostu podajcie linka zeby nie zasmiecac forum.

Dzięki za troskę o czystość forum. Wystarczy użyć wbudowanej w forum wyszukiwarki lub przejrzeć artykuły za php.pl
vtuner
ja osobiscie nie konfigurowalem ręcznie. Tylko zaistalowałem sobie Krasnala(można użyc tez WebServ) czyli poszedlem na łatwizne :roll2: ale wszystko dziala bez problemów.
Zelek
Ja tez mialem krasnala ale w wersji 2.7 jest wersja MySQLa za nieska i nie mozna w niej ustawiac kluczy obcych dlatego zrezygnowalem z Krasnoludka
anas
Hej.

Tak jak sam napisałeś, należy włączyć obsługę bazy mysql w php - a robi się to za pomocą np. dodania ładowanych rozszerzeń w pliku php.ini - dla systemów z rodziny windows, jak i linux/unix w pliku php.ini dodajemy linię:

Kod
exension=biblioteka.dll


lub dla linux/unix:

Kod
exension=biblioteka.so


Można również skompilować php łącznie z rozszerzeniem do obsługi baz danych, ale nie jest to zalecane.

Kolejna sprawa to z jakiego rozszerzenia skorzystasz, aktualnie do obsługi bazy mysql można skorzystać ze standardowego i powszechnie znanego zbioru funkcji i rozszerzenia: mysql, obiektowego mysqli - lub najnowszego rozwiązania php_pdo_mysql - ostatnie bardzo dobrze wypada w testach, a co waże stanowi też warstwę abstrakcyjną między bazą a aplikacją, co pozwoli nam w prosty sposób przesiadać się na inne system DBMS które obsługuje(np. postgresql, sqlite etc.)

Wszystkie rozszerzenia znajdziesz na stronie: PECL

pozdrawiam

anas
Zelek
Witam

generalnie to tak mam:
Kod
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".c:\php\lib\"

; The root of the php pages, used only if nonempty.
; if php was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues.  The alternate is to use the
; cgi.force_redirect configuration below
doc_root =

; The directory under which php opens the script using /~username used only
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\php\ext"

; Whether or not to enable the dl() function.  The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
enable_dl = On

; cgi.force_redirect is necessary to provide security running php as a CGI under
; most web servers.  Left undefined, php turns this on by default.  You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; cgi.force_redirect = 1

; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
; every request.
; cgi.nph = 1

; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape
; (iPlanet) web servers, you MAY need to set an environment variable name that php
; will look for to know it is OK to continue execution.  Setting this variable MAY
; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
; cgi.redirect_status_env =;

; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate
; security tokens of the calling client.  This allows IIS to define the
; security context that the request runs under.  mod_fastcgi under Apache
; does not currently support this feature (03/17/2002)
; Set to 1 if running under IIS.  Default is zero.
; fastcgi.impersonate = 1;

; Disable logging through FastCGI connection
; fastcgi.log = 0

; cgi.rfc2616_headers configuration option tells php what type of headers to
; use when sending HTTP response code. If it's set 0 php sends Status: header that
; is supported by Apache. When this option is set to 1 php will send
; RFC2616 compliant header.
; Default is zero.
;cgi.rfc2616_headers = 0


;;;;;;;;;;;;;;;;
; File Uploads;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = C:\php\uploadtemp; temporary directory for HTTP uploaded files (will use system default if not specified)

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M


;;;;;;;;;;;;;;;;;;
; Fopen wrappers;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

; Define the anonymous ftp password (your email address)
;from="john@doe.com"

; Define the User-Agent string
; user_agent="php"

; Default timeout for socket based streams (seconds)
default_socket_timeout = 60

; If your scripts have to deal with files from Macintosh systems,
; or you are running on a Mac and need to deal with files from
; unix or win32 systems, setting this flag will cause php to
; automatically detect the EOL character in those files so that
; fgets() and file() will work regardless of the source of the file.
; auto_detect_line_endings = Off


;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=mysql.dll
;
; Note that it should be the name of the module only; no directory information
; needs to go here.  Specify the location of the extension with the
; extension_dir directive above.


;Windows Extensions
;Note that ODBC support is built in, so no dll is needed for it.
;

;extension=php_mbstring.dll
;extension=php_bz2.dll
;extension=php_cpdf.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
extension=php_mysql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_w32api.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_yaz.dll
;extension=php_zip.dll


I wywala mi blad:
php Startup: Unable to load dynamic library 'C:\php\ext\php_mysql.dll' - nie moze odnalesc okreslonej procedury.

OK jako ze nie moge dodac 2 odpowiedzi pod rzad to chcialem powiedziec ze juz dziala, mienowicie sciagnelem nowe dll-ki ze stronki http://www.php.net/ zapakowalem je do katalogu i odrazu zahulalo smile.gif

Dziekuje wam wszystkim za pomoc biggrin.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.