Jump to content
php.lv forumi

Kā lai sasien kopā....?


Recommended Posts

Nu tā! Man izdevās sapārot Apache2 + php5 uz WinXP, bet nevaru sakabināt to visu ar MySQL! Varu likt ķīlā savu kreiso kāju :P, ka te ir cilvēki, kas man varētu pateikt, kas par lietu!

Uzinstaleju: MySQL Server 4.1, MySQL Administrator 1.0, mysqlcc. Šie tris turas kopā un strada savā starpā, bet ar Apache2 + php5 negrib ielaisties! Kapē?

 

Atradu kodu ar kura palīdzību, manu prāt es varu notestēt, vai Apache2 + php5 sadarbojas ar MySQL?

Te nu viņša ir:

<?
if (!mysql_connect("localhost","root","password"))
{
echo "Nevaru savienoties ar serveri!!!";
echo mysql_error();
exit;
}
echo "Strada! =)"
?>

Tad to ielieku Apache Serverī un palaižot lapeli, man izmet pašā html failā lūk šo tekstu:

1)Fatal error: Call to undefined function mysql_connect() in C:\www\html\index.php on line 2 Ja esmu koda beigās pielicis šitos! (; )

2) Bet ja noņemu šos (;)tad ir tā! Parse error: parse error, unexpected T_ECHO, expecting ',' or ';' in C:\www\html\index.php on line 5

 

Saprotu, ka viņš mēģina man ieskaidrot, ka vaina ir pašā kodā - vismaz man tā liekas! Bet ja šis kods nav riktīks, kā lai es tad uzinu, ka Viss NOTIEK!?:huh:

 

Ps: Esmu tikai tagad sācis apgūt PHP skriptu un šī ir mana pirmā reize, kad cenšos palais pilnvērtīgu serveri ar Apache + php + MySQL!

Link to comment
Share on other sites

:huh: Nezinu! Neko daudz man tie linki nepalīdzēja.

Ieliku iekš php.ini šitos te:

extension=php_mysql.dll

extension=php_mysqli.dll

Un palaižot to index.php man jau lec ārā divi paziņumi, ka neatrod jau minetos failus!

Man viņu nav! :( Un līdzi instalācijai ar nebija, ne pie php5 instalācījas, ne arī pie MySQL 4.1.

Kur, no kāda cauruma, lai es viņus izrauju? :blink:

 

ps: Godīgi izsakoties, es jau kādas divas dienas nemos gar Apach + php + MySQL sakabināšanu kopā! Pusotra diena pagāja kamēr saķīmiķoju Apach ar php! :angry: Nezinu sik ilgi vēl izturēšu!

Link to comment
Share on other sites

Tu laikam esi novilcis php .exe instalācijas failu nevis .zip arhīvu, jo .exe instalācijai tie faili nenāk līdzi. Novelc to .zip failu. Atarhivē uz c:\php. Tad savā php.ini failā norādi korekty extension_dir = c:/php/ext, tad atrodi rindiņu ";extension=php_mysqli.dll" un noņem semikolu priekšā. Tad iekopē libmysqli.dll failu uz sistēmas direktoriju. Un tad vajadzētu visam būt ok. Tikai nelieto mysql_xxx funkcijas, bet mysqli_xxx funkcijas!

Link to comment
Share on other sites

Paldies! Jūs esat vienkārši super! Paldies par jūsu pacietību! :D

Gribēju jums šo to vēl paprasīt - Kad saliku kopā PHP5 ar Apach 2 un sāku montēt MySQL, Pamanīju ka es vairs nevaru rar, zip failos atvērt instal.exe failus! Paši rar un zip arhivi man atveras un atarhivēt ar varu, bet tie faili, vai viņi būtu no kāda no arhivātoriem, vai arī jau Atarhivēti, Es nevaru viņus palaist! Viņi met ārā paziņojumu nevar atrast, vai paziņo, ka nav pareiza instalacījas faila atrašanās vieta!

Bet kad mēģinu atvērt savuos vecos zip un rar arhīvos INSTAL.exe failus, tie man aiziet bez nekādiem gļukiem! :huh:

 

Vai kādam ir bījis kas līdzīgs?

 

Ar cieņu GoDzila! :P

Link to comment
Share on other sites

Skaidrs, es jau tā domāju, tikai gribēju pārliecināties! ;) Jaturpin novērot :blink: :D kompis, kā strādā un kādas anomālījas parādās! Ja tas nepāries Nāksies to pārinstalēt! A varbūt es iemācīšos ar to sadzīvot, bet nu tas jau ir cits stāsts! :)

 

Velvienreiz - ar cieņu GoDzila! :P

Link to comment
Share on other sites

izdariju ka bubu teica, bet man radas sis:

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, einarsrvs@tvnet.lv and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

Apache/2.0.49 (Win32) Server at 83.99.139.197 Port 80

 

mos apache config failsla kautaks cits jaieraksta ? <_<

PHP 4 gaja...

Edited by Zoom
Link to comment
Share on other sites

Kad reiz cilvēki lasīt iemācīsies!?!

More information about this error may be available in the server error log.

Nu tad, lūdzams, paskaties savā error.log failā (tur kur ieinstalēta Apache zem direktorijas logs), kas tur labs pašās beigās rakstīts.

Link to comment
Share on other sites

[Tue Dec 07 00:35:09 2004][error] [client 83.99.160.253] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 00:36:01 2004] [error] [client 83.99.160.253] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 00:39:16 2004] [error] [client 83.99.160.253] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 11:35:05 2004] [notice] Parent: Created child process 392

[Tue Dec 07 11:35:07 2004] [notice] Child 392: Child process is running

[Tue Dec 07 11:35:07 2004] [notice] Child 392: Acquired the start mutex.

[Tue Dec 07 11:35:07 2004] [notice] Child 392: Starting 250 worker threads.

[Tue Dec 07 16:16:26 2004] [notice] Parent: Created child process 324

[Tue Dec 07 16:16:28 2004] [notice] Child 324: Child process is running

[Tue Dec 07 16:16:28 2004] [notice] Child 324: Acquired the start mutex.

[Tue Dec 07 16:16:28 2004] [notice] Child 324: Starting 250 worker threads.

[Tue Dec 07 17:50:43 2004] [warn] pid file C:/Program Files/Apache Group/Apache2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

[Tue Dec 07 17:50:44 2004] [notice] Parent: Created child process 328

[Tue Dec 07 17:50:45 2004] [notice] Child 328: Child process is running

[Tue Dec 07 17:50:45 2004] [notice] Child 328: Acquired the start mutex.

[Tue Dec 07 17:50:45 2004] [notice] Child 328: Starting 250 worker threads.

[Tue Dec 07 23:05:21 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:05:21 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:11:24 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:11:25 2004] [error] [client 82.193.64.90] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:/php/php.exe\\php_mysql.dll' - The specified module could not be found.\r

[Tue Dec 07 23:11:25 2004] [error] [client 82.193.64.90]  in Unknown on line 0

[Tue Dec 07 23:11:25 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:12:40 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:12:40 2004] [error] [client 82.193.64.90] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\php\\php.exe\\php_mysql.dll' - The specified module could not be found.\r

[Tue Dec 07 23:12:40 2004] [error] [client 82.193.64.90]  in Unknown on line 0

[Tue Dec 07 23:12:40 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:12:53 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:12:53 2004] [error] [client 82.193.64.90] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\php\\php_mysql.dll' - The specified module could not be found.\r

[Tue Dec 07 23:12:53 2004] [error] [client 82.193.64.90]  in Unknown on line 0

[Tue Dec 07 23:12:53 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:12:58 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:12:58 2004] [error] [client 82.193.64.90] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\php\\php_mysql.dll' - The specified module could not be found.\r

[Tue Dec 07 23:12:58 2004] [error] [client 82.193.64.90]  in Unknown on line 0

[Tue Dec 07 23:12:59 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:13:30 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:13:30 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:14:07 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:14:08 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:27:26 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:27 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:27:28 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:28 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:27:30 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:30 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:31 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:31 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:31 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:31 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:32 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:32 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:32 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:32 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:33 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:33 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:33 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:33 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:37 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:38 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:38 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:27:38 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:28:42 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:28:43 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:28:44 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:28:44 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:32:33 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:32:34 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:32:39 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:32:39 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:32:47 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/myphpadmin

[Tue Dec 07 23:32:47 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:33:23 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:33:24 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe, referer: http://83.99.139.197/admin/

[Tue Dec 07 23:33:25 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:39:16 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe, referer: http://83.99.139.197/admin/

[Tue Dec 07 23:39:16 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:39:17 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe, referer: http://83.99.139.197/admin/

[Tue Dec 07 23:39:17 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:39:18 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:39:20 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe, referer: http://83.99.139.197/admin/

[Tue Dec 07 23:39:20 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:39:21 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:39:21 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/myphpadmin

[Tue Dec 07 23:39:22 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:39:23 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:39:23 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

[Tue Dec 07 23:52:18 2004] [error] [client 82.193.64.90] Premature end of script headers: php.exe

[Tue Dec 07 23:52:18 2004] [error] [client 82.193.64.90] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

 

:D

Link to comment
Share on other sites

×
×
  • Create New...