new cv 2019
Just another web 3.0 blog :: prev - next

--- php 200 ok blank page bug ---

php 200 ok blank page bug : check for short array syntax (php5.4+) within your code, or place die(__FILE__.__LINE__) until you've found the file & line responsible for this

--- Website checklist ---

1) Has backups ( source, sql, medias, static files ) ? 2) Version Control ? 3) Portable ? Minimum dependencies ? Easy To Migrate settings ? 4) Mysql crash proof ? 5) Redis crash proof ? 6) Has a failsafe ? Failover ? 7) Has a developer logs && maintenance logs 8) Optimized queries, cache, 304, cdn 9) Elastic Ip adress or short TTL domain name ( in case main server has no failover and needs to be switched .. ) chown 33:33 -R .;#www-data ( apache or nginx user ) find . -type d -exec chmod 775 {} ; find . -type f -exec chmod 644 {} ; - Avoids spending 70% time switching files && environments - Avoids spending 25% time with phpmyadmin in prod environment - Avoids spending 15% time reviewing log files Using Frontcontroller : assume .php files can't be accessed directly by their respective urls ( frontcontroller defines FRONTCONTROLLER ), if(!defined('FRONTCONTROLLER'))die; Frontcontroller for 404 : send 200 headers if ressource matches a route

--- 9 layers php cache for high performance websites ---

The way of optimizing most PHP Websites are pretty simple & don't require any expensive webserver to run heavy load applications. ( quiet a long time since I haven't written anything here, becuz I've just never had the time at all ... ) The first places to look for any optimizations are obvioulsy within the mysql queries & php code : as for year 2008, this blog upon a collocation host, took more than 83 sec to generate a page as 4 users online .. First step : implement a timer & debug functions ( as registered shutdown functions ) within your code & log them !! Here is the 9 layers PHP cache I've setup this far : 1 : Mysql results cache & mysql inner cache & mysql indexes **** 2 : Full page html cache expires in future + binded with 304 handler ( with inner codes to invalidate data from separate block suppressed with grep upon cron ) ***** ( you won't see them performing better if you put them in ram .. as the page's output will take the more time here .. that's why 304 has to be implemented here ) 3 : Opcode cache ( newer php version are faster, indeed )** 4 : JSON serialized data arrays served with 304 headers whetever or not the data has been modified ( upon invalidation ) *** 5 : Array based file cache in Ram ( includes redis, memcache ) *** 6 : Individual static html files cache for individual blocks 7 : 304 headers using browser own cache **** 8 : Reverse-proxy : consider using a cdn is the same effect here 9 : Cdn : cloudflare Then I'll demystify some legends : - Well configured apache performs better than NGINX ( AllowOverride Off, logging static files .. ) - Amazon t2.micro instance aren't so expensive after all and are quite fast !

--- Design patterns ---

Design patterns : avoid overkill when not needed References : http://www.croes.org/gerald/blog/nutilisez-pas-les-design-patterns-en-php/109/ 70% of project don't have to be more complex you don't have to write 120 lines of code to perform what one line does It is pure falacy to pretend otherwise, except if you're a fanatic pretending it will be save of time for further developments .. Basically .. factory pattern is kindof "clever" one, singleton has it uses also, but more and more people tend to create their own ones, beeing such a mess ..

--- php7 ---

Php7 : les "benchmarks" font état de 100% de perfs supplémentaires soit un x2 sur l'execution de n'importe quel code php. Mais il ne faut pas attendre que ce x2 augmente le temps de réponse I/O tels que sql etc .. bref ne pas l'attendre comme un saveur

--- frameworks ---

Frameworks : http://socialcompare.com/fr/comparison/php-frameworks-comparison difficile de prouver que l'un est meilleur que l'autre tant que l'on peut tout effectuer en php natif,

--- flat php vs classes ---

flat php vs classes : class is an object, object is an array, who can have methods, methods are functions, for inner manipulations, outside the global space of flat php programming Faster to develop flat, global php

--- Racetrack bismuth framework php ---

Racetrack bismuth framework php Performant, Flexible, Portable & Highly Customizable !! Fruit of 7 Years of continuous development
  • Comes along with a CMS and website "skeletton" architecture, Rewriting for content pages
  • Sliders, Contents, Photo Album, Configuration + user Files Administration & Handling
  • Easy & Fast to administrate + Inline edition : Array of configuration "0.inc.php" + Reverse Eval Functions
  • Error Logging & Handling + Clever Shutdown functions
  • Comes with modules such as : banning according to regular expressions, performance benchmark, per file custom configuration, behaviour modifier, 301 redirects handler, apc storing, cache handler
  • Seo & Reporting
  • Performance Benchmarks & cache
  • Compactible with other frameworks
  • Extensive debugging methods, no mazy classes !
  • PHP,sql,js & css + sqlite interface ( very usefull for mutualized servers website development ) Inspired by common sense, my work, my physics studies, environment, travels, several jobs, companies, HR people, raspberry pi friends & ennemies
  • --- lenovo ---

    lenovo http://shop.lenovo.com/SEUILibrary/controller/e/frweb/LenovoPortal/fr_FR/catalog.workflow:item.detail?GroupID=38&Code=T52DNEU&category-id=2FAF239B768947AD95895F826C34447E usb mounting : the option "Allow sync with PC" was blocking it from being changed. By sync, I was thinking that contact/calendar/etc synching was blocked, not mount access.

    Developpeur php Geneve - php - rando - trip - india - web - php - dev - eco - science - astro - shop - annecy