PHP
How to PHP MongoDB extenstion
Installation of PHP MongoDB extenstion: wget “http://pecl.php.net/get/mongo-1.2.10.tgz” tar xzf mongo-1.2.10.tgz cd mongo-1.2.10/ /usr/local/php/bin/phpize ./configure –with-php-config=/usr/local/php/bin/php-config make sudo make install Add extension=mongo.so in php.ini vim /usr/local/php/lib/php.ini
How to enable error reporting in PHP
To enable error reporting you have to add the following ling in the top of your php file error_reporting(E_ALLÂ ^Â E_NOTICE);
A list of PHP Operator Types
The following operator types are available in PHP: Type Description Arithmetic Perform common arithmetical operations, such as addition and subtraction Assignment Assign values to variables Bitwise Perform operations on individual bits in an integer Comparison Compare values in a Boolean fashion (true or false is returned) Error Control Affect error handling (several new ones in [...]
A list of PHP Data Types
Although PHP is loosely typed, it does support many common simple and structured data types. Simple data types are types that contain a range of values that can be ordered in one dimension (strings, numbers, Booleans, and so on), whereas structured data types include arrays and objects. PHP has eight simple types, which are described [...]
Most important things to know about variables in PHP
Here are the most important things to know about variables in PHP ✦ All variables in PHP are denoted with a leading dollar sign ($). ✦ The value of a variable is the value of its most recent assignment. ✦ Variables are assigned with the = operator, with the variable on the left-hand side and the [...]
“Wrong permissions on configuration file, should not be world writable!”.
If you get this error message like “Wrong permissions on configuration file, should not be world writable!” in phpMyAdmin and page can not load.It could be because config.inc.php is given write permission. Simply run chmod a-w config.inc.php command it will solve your problem.
PHP Security – Designing Databases
The first step is always to create the database, unless you want to use one from a third party. When a database is created, it is assigned to an owner, who executed the creation statement. Usually, only the owner (or a superuser) can do anything with the objects in that database, and in order to [...]
How to Install PHP APC on GNU/Linux Centos 5
The instructions here detail how to get APC running on a CentOS 5 server. The server happened to have Plesk on it as well, which initially made me hesitant to install APC “normallyâ€, since Plesk is so picky on what other software is installed on the server. However, it seems to have worked out well. First, we need [...]
/usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
When compiling php if you get the following error /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied Resolution: Run the following command in Terminal chcon -t texrel_shlib_t /usr/local/apache/modules/libphp5.so
Cannot find autoconf. Please check your autoconf installation and the$PHP_AUTOCONF environment variable. Then, rerun this script.
When compiling memcache if you are encountering the following problem Cannot find autoconf. Please check your autoconf installation and the$PHP_AUTOCONF environment variable. Then, rerun this script. Resolution yum install autoconf
Access Microsoft SQL Server from PHP
On Windows machines, you can simply use the included ODBC support and the correct ODBC driver. On Unix machines, you can use the Sybase-CT driver to access Microsoft SQL Servers because they are (at least mostly) protocol-compatible. Sybase has made a » free version of the necessary libraries for Linux systems. For other Unix operating systems, [...]
How to build PHP with Apache 1.3.
This is actually quite easy. Follow these steps carefully: Grab the latest Apache 1.3 distribution from » http://httpd.apache.org/download.cgi. Ungzip and untar it somewhere, for example /usr/local/src/apache-1.3. Compile PHP by first running ./configure –with-apache=/<path>/apache-1.3 (substitute <path> for the actual path to your apache-1.3 directory). Type make followed by make install to build PHP and copy the necessary files to the Apache [...]
fatal: relocation error: file /path/to/libphp4.so: symbol ap_block_alarms: referenced symbol not found
fatal: relocation error: file /path/to/libphp4.so: symbol ap_block_alarms: referenced symbol not found This error usually comes up when one compiles the Apache core program as a DSO library for shared usage. Try to reconfigure apache, making sure to use at least the following flags: –enable-shared=max –enable-rule=SHARED_CORE For more information, read the top-level Apache INSTALL file or [...]
checking lex output file root… ./configure: lex: command not found
While configuring PHP (./configure), you come across an error similar to the following: checking lex output file root… ./configure: lex: command not found configure: error: cannot find output from lex; giving up Be sure to read the installation instructions carefully and note that you need both flex and bison installed to compile PHP. Depending on [...]
Is PHP limited to process GET and POST request methods only
No, it is possible to handle any request method, e.g. CONNECT. Proper response status can be sent with header(). If only GET and POST methods should be handled, it can be achieved with this Apache configuration: Deny from all
