A hashtag - # within a hyperlink specifies an html element id to which the window should be scrolled.
href="#some-id" would scroll to an element on the current page such as <div id="some-id">.
href="//site.com/#some-id" would go to site.com and scroll to the id on that page.
href="#" doesn't specify an id name, but does have a corresponding location - the top of the page. Clicking an anchor with href="#" will move the scroll position to the top.
// Please make sure the PHP extensions listed below are installed.
mCrypt
// PECL is a repository of PHP extensions that are made available to you via the » PEAR packaging system.
// There are several options for downloading PECL extensions, such as:
o The pecl install extname command downloads the extensions code automatically, so in this case there is no need for a separate download.
o » http://pecl.php.net/ The PECL web site contains information about the different extensions that are offered by the PHP Development Team. The information available here includes: ChangeLog, release notes, requirements and other similar details.
o pecl download extname PECL extensions that have releases listed on the PECL web site are available for download and installation using the » pecl command. Specific revisions may also be specified.
o SVN Most PECL extensions also reside in SVN. A web-based view may be seen at » http://svn.php.net/viewvc/pecl/. To download straight from SVN, the following sequence of commands may be used:
$ pecl search mCrypt
Retrieving data...0%
Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
mcrypt_filter 0.1.0 (beta) Applies mcrypt symmetric encryption using stream filters
$ pecl install mcrypt_filter
Failed to download pecl/mcrypt_filter within preferred state "stable", latest release is version 0.1.0, stability "beta", use "channel://pecl.php.net/mcrypt_filter-0.1.0" to install
install failed
$ pecl install channel://pecl.php.net/mcrypt_filter-0.1.0/mcrypt_filter
Attempting to discover channel "pecl.php.net/mcrypt_filter-0.1.0"...
Attempting fallback to https instead of http on channel "pecl.php.net/mcrypt_filter-0.1.0"...
unknown channel "pecl.php.net/mcrypt_filter-0.1.0" in "channel://pecl.php.net/mcrypt_filter-0.1.0/mcrypt_filter"
invalid package name/package file "channel://pecl.php.net/mcrypt_filter-0.1.0/mcrypt_filter"
install failed
$ pecl install channel://pecl.php.net/mcrypt_filter-0.1.0
Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user
DongMeiliangsMacBook-Pro:upload dongmeiliang$ sudo pecl install channel://pecl.php.net/mcrypt_filter-0.1.0
Password:
downloading mcrypt_filter-0.1.0.tgz ...
Starting to download mcrypt_filter-0.1.0.tgz (4,586 bytes)
...
checking for mcrypt support... yes, shared
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
ERROR: `/private/tmp/pear/install/mcrypt_filter/configure --with-php-config=/usr/bin/php-config' failed
// Resolve configure: error: mcrypt.h not found. Please reinstall libmcrypt.
Get libmcrypt 2.5.8 from Sourceforge: http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download
$ tar -zxvf libmcrypt-2.5.8.tar.gz
$ mkdir -p /usr/local/src
$ mv libmcrypt-2.5.8 /usr/local/src/
$ cd /usr/local/src/libmcrypt-2.5.8/
$ ./configure --prefix=/usr/local
$ make && make install
// Continue install mCrypt extension
$ sudo pecl install channel://pecl.php.net/mcrypt_filter-0.1.0
...
12472464 40 -rwxr-xr-x 1 root wheel 16704 Feb 15 21:41 /private/tmp/pear/install/pear-build-rootEyJ4Jg/install-mcrypt_filter-0.1.0/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt_filter.so
Build process completed successfully
Installing '/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt_filter.so'
ERROR: failed to write /usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt_filter.so (copy(/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt_filter.so): failed to open stream: Operation not permitted)
We need to disable SIP.
OSX 10.11 El Capitan ships with a new security process referred to as SIP or Security Integrity Protection also known as rootless.
What this essentially does is protect certain system level directories from being changes, notably
o /System
o /sbin
o /usr
o not /usr/local
// Disabling SIP in OSX
o Reboot your Mac into Recovery Mode by rebooting and holding down ‘command’ + ‘r’
o Launch a Terminal session and enter csrutil disable
o Reboot
// Reinstall mCrypt extension
$ sudo pecl install channel://pecl.php.net/mcrypt_filter-0.1.0
...
Build process completed successfully
Installing '/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt_filter.so'
install ok: channel://pecl.php.net/mcrypt_filter-0.1.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=mcrypt_filter.so" to php.ini
4.Install mcrypt for php on Mac OSX 10.11 El Capitan
o Disable SIP/rootless
You need to disable the new System Integrity Protection to install into some system protected directories – this involves a recovery reboot and disabling with.
Move both of these files that you downloaded into your working directory – mcrypt in this instance, and go back to Terminal
1
$ cd ~/mcrypt
Expand both files via the command line or just double click them in the Finder:
12
$ tar -zxvf libmcrypt-2.5.8.tar.gz
$ tar -zxvf php-5.5.27.tar.gz
o Configuring libmcrypt
1234
$ cd libmcrypt-2.5.8
$ ./configure
$ make
$ sudo make install
o Compile mcrypt php Extension
12345
$ cd ../php-5.5.27/ext/mcrypt/
$ /usr/bin/phpize
$ ./configure
$ make
$ sudo make install
o Enabling mcrypt.so php Extension
1234567891011121314151617
// Open /etc/php.ini and add the line below at the end
extension=mcrypt.so
// If there is no php.ini file, then you need to make one from php.ini.default in the same location like so:
$ sudo cp /etc/php.ini.default /etc/php.ini
// And allow write capability
$ sudo chmod u+w /etc/php.ini
// Then add the line as above in your favourite text editor:
$ sudo vi /etc/php.ini
// make sure dynamic extensions are set to on…
extension_dl = On
// If it didn’t load you may need to declare the extensions directory in /etc/php.ini
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20100525/"
o Restart Apache
1
$ sudo apachectl restart
That’s it, create a php page with the function phpinfo(); to see if it loaded correctly.
$ php arrayTests.php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20121212/' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/, 9): no suitable image found. Did find:
/usr/lib/php/extensions/no-debug-non-zts-20121212/: not a file in Unknown on line 0
7.Why should the ‘&’ (ampersand) character be HTML escaped?
A:The reason we escape the & is precisely because it is the first character in special characters such as &rsquo. If it is not escaped, some programs may be expecting a special character to begin when they see the ampersand.
But it is only escaped when you actually want the ampersand to show. You would not escape it in a special character. So you would always use &rsquo and never &rsquo.
There are some other projects which you can try as well.
Basically, you need to upload, unpack and start running the process.
On the frontend, you’ll have javascript connecting to the server on the specific port.
Most websocket servers have a demo which echoes back whatever it hears, so this is a good place to write some test code. You may even find a rudimentary chat implementation.
The tricky part is to monitor the web socket server and to make sure it runs smoothly and continuously.
Try to test on as many browsers/devices as possible as this will decide on which websocket server implementation you choose. There are old and new protocols you have to watch out for.
11.How do I enable apache file and directory indexing under Linux or UNIX?
A:Under Apache web server automatic index generation is enabled with using Options +Indexes or Options Indexes directive.
If a URL which maps to a directory is requested, and there is no DirectoryIndex (e.g., index.html) in that directory, then mod_autoindex will return a formatted listing of the directory.
123456789101112131415161718192021222324252627
// Option 1: Using Apache config file
// Add directory option to Apache configuration file /etc/httpd/httpd.conf or /etc/apache2/apache2.conf:
# vi /etc/apache2/apache2.conf
// Add following code:
<Directory /var/www/domain.com/pdfs>
Options Indexes FollowSymLinks
</Directory>
// Save and close the file. Restart Apache:
# /etc/init.d/httpd restart
// OR
# /etc/init.d/apache2 restart
// Option 2: Using .htaccess Files with Apache
// You can place config line Options Indexes in .htaccess file. Make sure .htaccess file support is enabled.
// Change directory to pdfs
$ cd pdfs
// Open .htaccess file
$ vi .htaccess
// Append following apache directive:
Options Indexes
//Save and close the file.