Ako na vlastný server – V. (PHP)

V následujúcej časti nášho seriálu sa pozrieme na inštaláciu PHP na distribúcii Debian. Ukážeme si ako prepojiť PHP a MySQL, ďalej prácu PHP pod Apache2. Pozrieme sa aj na nebezpečné PHP funkcie pre Váš server.

Ako prvé si nainštalujeme PHP5
apt-get install php5 php5-common
Keď už máme základné PHP nainštalované, odporúčam nainštalovať aj následovné knižnice pre PHP a modul pre Apache2.
apt-get install libapache2-mod-php5 php5-curl php5-dev php5-gd php-pear php-mail php5-mysql
PHP v Apache zapneme spustením príkazu
a2enmod php5

Konfigurácia PHP5
Konfiguračný súbor pre PHP nájdeme v priečinku /etc/php5/apache2/php.ini.
V php5 je dôležité mať zapnutý safe mod, ktorý je defaultne vypnutý.
safe_mode = On
safe_mode_gid = On

Pokiaľ sa jedná o verejnú službu (webhosting) pre bezpečnosť je veľmi dôležité upraviť disable_functions.
disable_functions = proc_nice, proc_terminate, proc_get_status, proc_close, shell_exec,proc_open,ini_alter,dl,system, leak,shell_exec, proc_open, syslog,link,readlink,symlink,error_log,ini_restore,openlog,passthru,socket_create,
socket_write,shmop_close,shmop_delete,shmop_open,shmop_read,shmop_size,shmop_size

Ďalej odporúčam nastavenia
; 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

a
register_globals = Off

Užitočné nastavenia
Maximálnu veľkosť upload súboru meníme v upload_max_filesize.
Maximálna veľkosť odoslaného súboru cez POST post_max_size.

4 099 Responses to “Ako na vlastný server – V. (PHP)”

  1. Bonjour…

    You should take part in a contest for one of the best blogs on the web. I will recommend this site!…

  2. Coupon Suzy hovorí:

    Great Clips Coupons…

    [...]below are a couple of web links to websites online which we connect to seeing that we think they are worthy of visiting[...]…

  3. Bouncy Castles hovorí:

    Read was interesting, stay in touch……

    [...]please visit the sites we follow, including this one, as it represents our picks from the web[...]……

  4. muscle endurance hovorí:

    Informative and precise…

    Its hard to find informative and accurate information but here I noted…

  5. Great Clips Coupons…

    [...]following are several hyper-links to webpages I always link to because we feel they are well worth browsing[...]…

  6. Yahoo results…

    While browsing Yahoo I found this page in the results and I didn’t think it fit…

  7. [...]the time to read or visit the content or sites we have linked to below the[...]……

    [...]here are some links to sites that we link to because we think they are worth visiting[...]……

  8. Wikia…

    Wika linked to this website…

  9. Cool site…

    [...]below you’ll find the link to some sites that we think you should visit[...]…

  10. Dreary Day…

    It was a dreary day here yesterday, so I just took to messing around on the internet and realized…

  11. ubieranki hovorí:

    Great news…

    Great news. Let’s share this together…

  12. Test only hovorí:

    Read was interesting, stay in touch……

    [...] further down you’ll discover the link for some sites that many of us presume you must visit [...]…

  13. Looking around…

    I like to surf around the web, often I will just go to Digg and read and check stuff out…

  14. Yahoo results…

    While browsing Yahoo I discovered this page in the results and I didn’t think it fit…

  15. Free Diets hovorí:

    hello…

    you have a great blog here! would you like to make some invite posts on my blog?…

  16. közösségi portálok…

    [...]the time to read or visit the content or sites we have linked to below the[...]…

  17. Hey!…

    Spot on with this write-up, I truly think this website needs much more consideration. Ifll probably be again to read much more, thanks for that info….

  18. steel coffee cup hovorí:

    [...]always a big fan of linking to bloggers that I love but don’t get a lot of link love from[...]……

    [...]just beneath, are numerous totally not related sites to ours, however, they are surely worth going over[...]……

  19. Read More…

    [...]…Great Post…[...]…

  20. [...]The information mentioned in the article are some of the best available [...]……

    [...]below you’ll find the link to some sites that we think you should visit[...]……

  21. career choice hovorí:

    Hello!…

    An interesting discussion is worth comment. I think that you should write more on this topic, it might not be a taboo subject but generally people are not enough to speak on such topics. To the next. Cheers…

  22. Hello!…

    An interesting discussion is worth comment. I think that you should write more on this topic, it might not be a taboo subject but generally people are not enough to speak on such topics. To the next. Cheers…

  23. Tumblr article…

    I saw someone writing about this on Tumblr and it linked to…

  24. interaktivt hovorí:

    Hey…

    very nice post, i certainly love this website, keep on it…

  25. News info…

    I was reading the news and I saw this really interesting info…

  26. Looking around…

    I like to browse in various places on the web, regularly I will just go to Digg and read and check stuff out…

  27. Read More…

    [...]…We like this Blog…[...]…

  28. Charity Gifts hovorí:

    Thanks…

    Can I just say what a relief to find someone who actually knows what theyre talking about on the internet. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of the story. I …

  29. bus accident hovorí:

    [...] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate, just click the links over[...]……

    [...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……

  30. sprint training hovorí:

    Online Article……

    [...]The information mentioned in the article are some of the best available [...]……

  31. Thanks you…

    There are some interesting points in time in this article but I donft know if I see all of them center to heart. There is some validity but I will take hold opinion until I look into it further. Good article , thanks and we want more! Added to FeedBur…

  32. speed training hovorí:

    Recent Blogroll Additions……

    [...]usually posts some very interesting stuff like this. If you’re new to this site[...]……

  33. Yahoo results…

    While browsing Yahoo I discovered this page in the results and I didn’t think it fit…

  34. Septic Tank hovorí:

    Thank you…

    I was very pleased to find this web-site.I wanted to thanks for your time for this wonderful read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post….

  35. birth injury hovorí:

    [...] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate, just click the links over[...]……

    [...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……

  36. Great blog…

    The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you coul…

  37. jewelry art hovorí:

    Gems form the internet…

    [...]very few websites that happen to be detailed below, from our point of view are undoubtedly well worth checking out[...]……

  38. Digg…

    While checking out DIGG today I found this…

  39. Wikia…

    Wika linked to this website…

  40. Dreary Day…

    It was a dreary day here yesterday, so I just took to messing around on the internet and found…

  41. Just Browsing…

    While I was browsing yesterday I noticed a great article about…

  42. affiliate hovorí:

    Sites we Like……

    [...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……

  43. serotonin hovorí:

    Online Articles…

    [...]The information mentioned in the article are some of the best available [...]……

  44. knee injury hovorí:

    [...]The information mentioned in the article are some of the best available [...]……

    [...]below you’ll find the link to some sites that we think you should visit[...]……

  45. Looking around…

    I like to browse around the web, regularly I will just go to Digg and follow thru…

  46. Looking around…

    I like to browse around the online world, regularly I will go to Digg and read and check stuff out…

  47. Its hard to find good help…

    I am regularly saying that its difficult to get good help, but here is…

  48. Hey!…

    Spot on with this write-up, I truly think this website needs much more consideration. Ifll probably be again to read much more, thanks for that info….

  49. News info…

    I was reading the news and I saw this really interesting topic…

  50. SEO MURAH hovorí:

    You should check this out…

    [...] Wonderful story, reckoned we could combine a few unrelated data, nevertheless really worth taking a look, whoa did one learn about Mid East has got more problerms as well [...]……

Leave a Reply