Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php+mysql] Ciężkie początki
ogr33
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 28.04.2006

Ostrzeżenie: (0%)
-----


Witajcie!
To mój pierwszy kontakt, tak że wietam wszystkich.
Mam prozaiczny wydawało by sie problem.
Instalowałem i konfigurowałem ręcznie php+msql+apache.
Wszystko działa apache poprawnie interprotuje dokumenty
php tez bez wiekszych problemów.
Problem natomias mam przy próbie plołączenia sie z bazą.
Po wykonaniu takiego skryptu:

  1. <?php
  2.  mysql_connect("localhost", "root", "pass");
  3.  mysql_select_db(siatka);
  4.  $oSQL = mysql_query('selest * form gracz') ;
  5.  while ($aRekord = mysql_fetch_array($oSQL))
  6.  {
  7. echo "pole".$aRekord[0];
  8.  }
  9. ?>


Otrzymuje taki komunikat.

Cytat
Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\test-2-php-info\info.php on line 2


Wygląda na to ze nie moze nawiązac połączenia z serwerem mysql.
Nie bardzo wiem jak temu zaradzić.
Ma ktoś jakiś pomysł?

Pozdrawiam serdecznie:
Bartek.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
dzesi
post
Post #2





Grupa: Zarejestrowani
Postów: 235
Pomógł: 0
Dołączył: 3.05.2006

Ostrzeżenie: (0%)
-----


Mam problem :] zainstalowałem apache php + mysql php działa ale mysql nie phpinfo go nie wykrywa tzn mysql5 i php 5.2:]bibioteke libmysql przeniosłem do system32 i do apache /bin w php.ini odznaczyłem
extension=php_mssql.dll
extension=php_msql.dll
extension=php_mysql.dll
extension=php_dba.dll
extension=php_dbase.dll
i mysql nie jest połaczone z php moge wiedziec co zle robie:>?

moj php.ini



; 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:/uploud

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


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

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

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
allow_url_include = Off

; 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=msql.so
;
; 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.
; Note that many DLL files are located in the extensions/ (php 4) ext/ (php 5)
; extension folders as well as the separate PECL DLL download (php 5).
; Be sure to appropriately set the extension_dir directive.

;extension=php_mbstring.dll
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.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_imap.dll
;extension=php_interbase.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_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll

wycinek php ini ps: czy plik php INI-DIST ma byc taki czy mam zapisac na php.ini bo ja zapisuje na php.ini błągam was pomózcie:]
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Date]
; Defines the default timezone used by the date functions
;date.timezone =

[Syslog]
; Whether or not to define the various syslog variables (e.g. $LOG_PID,
; $LOG_CRON, etc.). Turning it off is a good idea performance-wise. In
; runtime, you can define these variables by calling define_syslog_variables().
define_syslog_variables = Off

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

[SQL]
sql.safe_mode = Off

[ODBC]
;odbc.default_db = Not yet implemented
;odbc.default_user = Not yet implemented
;odbc.default_pw = Not yet implemented

; Allow or prevent persistent links.
odbc.allow_persistent = On

; Check that a connection is still valid before reuse.
odbc.check_persistent = On

; Maximum number of persistent links. -1 means no limit.
odbc.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
odbc.max_links = -1

; Handling of LONG fields. Returns number of bytes to variables. 0 means
; passthru.
odbc.defaultlrl = 4096

; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char.
; See the documentation on odbc_binmode and odbc_longreadlen for an explanation
; of uodbc.defaultlrl and uodbc.defaultbinmode
odbc.defaultbinmode = 1

[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
mysql.max_links = -1

; Default port number for mysql_connect(). If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
mysql.default_port =

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =root

; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with php access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
mysql.default_password =haker1

; Maximum time (in seconds) for connect timeout. -1 means no limit
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Errors will be displayed.
mysql.trace_mode = Off

[MySQLi]

; Maximum number of links. -1 means no limit.
mysqli.max_links = -1

; Default port number for mysqli_connect(). If unset, mysqli_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
mysqli.default_port = 3306

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysqli.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysqli.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysqli.default_user =

; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with php access can run 'echo get_cfg_var("mysqli.default_pw")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = Off

[mSQL]
; Allow or prevent persistent links.
msql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
msql.max_persistent = -1

; Maximum number of links (persistent+non persistent). -1 means no limit.
msql.max_links = -1
Go to the top of the page
+Quote Post

Posty w temacie
- ogr33   [php+mysql] Ciężkie początki   28.04.2006, 20:20:04
- - mike_mech   1. Poprawiem bbCode. Następnym razem sam zastosuj...   28.04.2006, 20:30:02
- - TomASS   Zpytanie akurat nic nie ma do tego błędu. Zrób sk...   29.04.2006, 09:04:19
- - kpwig   Że nie ma to widać, ale wypadałoby o tym wspomnieć...   29.04.2006, 09:17:08
- - nospor   no skoro juz mowimy, ze zapytanie jest be, to wypa...   29.04.2006, 09:19:16
- - ogr33   Literówka rzeczywiście jest, ale zapytania sql...   29.04.2006, 11:04:22
- - mike_mech   Upewnij sie jeszcze że dyrektywa extension_dir w p...   29.04.2006, 11:09:07
- - ogr33   Tak dyrektywa wskazuje poprawną ścieżkę. Bibliotek...   29.04.2006, 11:30:39
- - Master Miko   Jeśli jesteś początkującym, polecam Ci poprostu za...   29.04.2006, 11:33:59
- - ogr33   Uff... dwa dni ślęczenia nad plikami konfiguracyjn...   29.04.2006, 18:28:48
- - henio   Ja mam troszeczkę inny problem! Odkomentowałem...   6.05.2006, 10:47:05
- - Gość_Henio   W moim skrypcie po drobnych zmianach wyświetla się...   7.05.2006, 08:31:21
- - nospor   drogi heniu. to juz chyhba nie ma związku z brakie...   7.05.2006, 08:36:07
- - henio   Po pierwsze jak w domu ma się 4 osoby do komputera...   7.05.2006, 08:49:18
- - LBO   W ten sposób (urzycie nazwy zmiennej $end) pa...   7.05.2006, 09:02:16
- - henio   plik dodaj_banner1.php [PHP] pobierz, plaintext ...   7.05.2006, 10:06:26
- - mike_mech   1. Proszę poprawic posta powyżej stosując odpowie...   7.05.2006, 10:11:33
- - henio   Cytat(mike_mech @ 2006-05-07 09:11:33)1. Pro...   7.05.2006, 10:15:34
- - mike_mech   Może to zabrzmi smiesznie ale powinienem Ci właśni...   7.05.2006, 10:17:46
- - henio   Cytat(mike_mech @ 2006-05-07 09:17:46)Może to...   7.05.2006, 10:24:34
- - mike_mech   Nie wiem czy dostrzegasz ale mój poprzedni post mi...   7.05.2006, 10:27:21
- - henio   dodaj_banner1.php [PHP] pobierz, plaintext <ht...   7.05.2006, 10:36:11
- - mike_mech   insert_id jest polem klasy mysqli a nie polem w ob...   7.05.2006, 10:49:11
- - henio   Cytat(mike_mech @ 2006-05-07 09:49:11)insert_...   7.05.2006, 10:57:34
- - mike_mech   Ty masz poważne problemy ze zrozumieniem tego co c...   7.05.2006, 11:07:57
- - henio   Teraz jest ok! Tylko, że wyświetla mi się: Da...   7.05.2006, 11:20:46
- - mike_mech   To może tuż przed wykonaniem zapytania wyświetl so...   7.05.2006, 11:36:42
- - henio   Wyświetla się Kodinsert into bannery (link, a...   7.05.2006, 11:44:45
- - dzesi   Mam problem :] zainstalowałem apache php + mysql p...   8.10.2006, 13:07:18


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 14:18