PHP APC (Alternative PHP Cache / Opcode Cache) is framework that optimizes PHP intermediate code and caches data and compiled code from the PHP bytecode compiler in shared memory. APC Opcode Cache is quickly becoming the de-facto standard PHP caching mechanism.
(adsbygoogle = window.adsbygoogle || []).push({});PHP APC installation is very easy, example with Fedora / CentOS / Red Hat (RHEL) you can check following guides to see howto install it:
This is guide, howto install phpMyAdmin 4.3.10 with Nginx or Apache on Fedora 21/20/19, CentOS 7/6.6/5.11 and Red Hat (RHEL) 7/6.6/5.11 servers. phpMyAdmin needs web server with PHP and MySQL database. This guide uses Apache web server with PHP 5.6 or Nginx web server with PHP 5.6 (PHP-FPM) and MySQL 5.6 database server or MariaDB 10/5.5 database server. You can also use your already installed versions of web server, PHP and MySQL.
This is a PHP, PDO and SQLite3 example, which demonstrates the SQLite3 databse usage with PHP-PDO. The PHP / PDO / SQLite3 example code demonstrates following things, and their use:
Create / Connect SQLite3 databases Use SQLite3 file and memory databases Create tables in SQLite3 database Use SQLite3 db different datetime formats Insert data to SQLite3 database PDO / SQLite3 prepared statements Bind parameters to statement variables Bind values to statement variables Quote a string for use in a query Update data in SQLite3 database Select / Query from SQLite3 database and print query output Drop SQLite3 table Close SQLite3 connections PHP / PDO / SQLite3 Example Code <?
LEMP (Linux, Nginx, MySQL, PHP) server is extremely powerful setup behind any website or web based service. This guide is collection of Fedora/CentOS/Red Hat (RHEL), Nginx, MariaDB/MySQL and PHP (PHP-FPM) install guides.
This guide (more specifically this guide parts) try to explain in more detail LEMP (Linux, Nginx, MariaDB/MySQL, PHP (PHP-FPM)) server environment installation. This howto can be used to pre-installed Linux, and instructions can be used for various Fedora and Red Hat based Linux distros with YUM.
Sometimes it’s nice to know or even very important to know, how much your PHP script is using memory. This is a simple example of a class, which can be used to collect the PHP script memory usage information and to print all information. It’s easy to reformat output, if you want to use it example on web page or command line script. Or even do another function for web pages and another for command line scripts.
This is guide howto install Nginx with PHP 7.2.12 and PHP-FPM on Fedora 29/28/27, CentOS 7.5/6.10 and Red Hat (RHEL) 7.5/6.10. PHP-FPM is easier to use and configure than FastCGI and some tests says that PHP-FPM is even much more efficient than FastCGI.
Nginx (engine x) is a robust, small and high performance http server, reverse proxy server and also mail proxy server.
PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.
This is quick guide, howto install Zend Framework (ZF) 1.12.3 on Fedora 18/17/16/15, CentOS 6.4/6.3/6.2/6.1/6/5.9 and Red Hat (RHEL) 6.4/6.3/6.2/6.1/6/5.9. This guide also works with older Fedora releases, like Fedora 13/12/11 and also with older CentOS/Red Hat RHEL 5 releases. I use Remi repository here because it’s updated more frequently than example Fedora’s own repositories.
What is Zend Framework? Zend Framework is a simple, straightforward, open-source software framework for PHP 5 designed to eliminate the tedious details of coding and let you focus on the big picture.
This is a very common PHP question, how to remove last character from string in PHP?
So here are three ways how to delete last character from string in PHP.
Method 1 – PHP: Remove Last Character from String using substr and mb_substr substr and mb_substr commands usage substr($string, 0, -1); mb_substr($string, 0, -1); substr and mb_substr example: $string = "This is test string.."; echo $string . "\n"; // substr function echo "substr: " .
This is guide, howto install WordPress 4.1.1 with Nginx or Apache on Fedora 21/20/19, CentOS 7/6.6/5.11 and Red Hat (RHEL) 7/6.6/5.11 servers. WordPress needs web server with PHP and MariaDB or MySQL database. This guide uses Apache web server with PHP 5.6 or Nginx web server with PHP 5.6 (PHP-FPM) and MariaDB 10/5.5 database server or Mysql 5.6 database server.
If you want to install WordPress with Apache then use a – [Apache] sections and if you want install WordPress with Nginx then use b – [Nginx] sections.
LAMP (Linux, Apache, MariaDB/MySQL, PHP) server is very powerful server setup behind any website or web based service. This guide is collection of Fedora/CentOS/Red Hat (RHEL), Apache, MariaDB/MySQL and PHP install guides.
Today the Internet is full of instructions, which promises a LAMP server installation with a “One-Liner”, and so forth. In fact, these “One-Liner” instructions assume that, Linux is already installed and installs just AMP (Apache, MariaDB/MySQL, PHP) pakages, without any configuration.
This guide shows howto install Apache HTTP Server (httpd) with PHP 7.2.12 and following modules on Fedora 29/28/27, CentOS 7.5/6.10 and Red Hat (RHEL) 7.5/6.10 systems.
OPcache (php-opcache) – The Zend OPcache provides faster PHP execution through opcode caching and optimization. APCu (php-pecl-apcu) – APCu userland caching CLI (php-cli) – Command-line interface for PHP PEAR (php-pear) – PHP Extension and Application Repository framework PDO (php-pdo) – A database access abstraction module for PHP applications MySQL (php-mysqlnd) – A module for PHP applications that use MySQL databases PostgreSQL (php-pgsql) – A PostgreSQL database module for PHP MongoDB (php-pecl-mongodb) – PHP MongoDB database driver Redis (php-pecl-redis) – Extension for communicating with the Redis key-value store Memcache (php-pecl-memcache) – Extension to work with the Memcached caching daemon Memcached (php-pecl-memcached) – Extension to work with the Memcached caching daemon GD (php-gd) – A module for PHP applications for using the gd graphics library XML (php-xml) – A module for PHP applications which use XML MBString (php-mbstring) – A module for PHP applications which need multi-byte string handling MCrypt (php-mcrypt) – Standard PHP module provides mcrypt library support 1.
This is guide, howto install latest Eclipse Mars.2 4.5.2 on Fedora, CentOS and Red Hat (RHEL). This guide should work with Fedora 24/23/22/21/20/19/18/17/16/15/14/13/12, CentOS 7.2/6.8/5.11 and Red Hat (RHEL) 7.2/6.8/5.11 and even with earlier versions. Latest working version on CentOS/RHEL 5.11 is Eclipse Luna 4.4.2.
Eclipse is a multi-language software development environment comprising an integrated development environment (IDE) and an extensible plug-in system. It is written primarily in Java and can be used to develop applications in Java and, by means of various plug-ins, other languages including C, C++, COBOL, Python, Perl, PHP, Scala and Ruby (including Ruby on Rails framework).
PHP’s ucfirst function is very usefull when you want to change words first letters to uppercase and other letters to lowercase. Currently on PHP does not have a multibyte (UTF-8) version of ucfirst function. So I decided write my own multibyte mb_ucfirst function.
Perhaps the multibyte version of ucfirst function is added later on PHP, so that’s why is better add this function only if it does not already exist.
PHP MongoDB (Mongo Database) Driver Installation on Linux, UNIX, BSD and Mac OS X MongoDB PHP driver is very simple install on Linux, UNIX, BSD and Mac OS X. You need just PEAR (PHP Extension and Application Repository) with PECL repository. Normally PHP development (dev) package and PHP Pear package installation from package management system is enough to get PEAR working. Also go-pear.php script can be used.
Check that the PEAR and PECL are working with the following commands:
PHP has large number of predefined constants. This HOWTO will present the seven most important, most practical and most useful PHP Magic Constants.
FILE – The full path and filename of the file. DIR – The directory of the file. FUNCTION – The function name. CLASS – The class name. METHOD – The class method name. LINE – The current line number of the file. NAMESPACE – The name of the current namespace This is example PHP script with comments, which demonstrate howto use all previously mentioned PHP Magic Constants.
I was using simple function to calculate difference between two dates and timestamps until I noticed, it’s not working correctly in long intervals. It’s very easy to calculate difference between two timestamps in seconds, but it’s much more complicated print difference in human readable format. The Internet can be found in a wide range of ways to do this thing, but as a rule they use a fixed amount of seconds for the year and the month.
PHP Command Line Interface (CLI) has not built-in coloring for script output, like example Perl language has (perldoc.perl.org/Term/ANSIColor.html). So I decided to make own class for adding colors on PHP CLI output. This class works only Bash shells. This class is easy to use. Just create new instance of class and call getColoredString function with string and foreground color and/or background color.
PHP Class for Coloring PHP Command Line (CLI) Scripts Output <?
In many cases, it is really useful to know the exact time for how long a PHP script is running or how long will take PHP web page load. On the other hand it is also useful to know that how long a particular script operation or part of page load will take.
Following PHP Timing class is very simple to use, only create class and start timing and stop timing.
I think every PHP coders have come accross Arrays and stdClass Objects (belongs to PHP Predefined Classes). Sometimes it’s very useful convert Objects to Arrays and Arrays to Objects. This is easy if arrays and objects are one-dimensional, but might be little tricky if using multidimensional arrays and objects.
This post defines two ultra simple recursive function to convert multidimensional Objects to Arrays and multidimensional Arrays to Objects.
Function to Convert stdClass Objects to Multidimensional Arrays <?