Friday, December 15, 2017

Invalid command '\xef\xbb\xbf#', perhaps misspelled or defined by a module not included in the server configuration


\xef\xbb\xbf are three invisible junk characters (at least from Apache's perspective) called the Unicode BOM, or byte order mark. Apache thinks that those characters are part of the command that follows right after. This is what you see in the log, though the characters are escaped so they're visible to the naked eye. \xef\xbb\xbfRewriteEngine

Copy the content in any advanced notepad editor which will detect the characters and you can easily remove them.

If you are not able to see these characters, remove this file completely and write again.

cpanel - wordpress - internal server error because of invalid permissions

cpanel - wordpress application - fix wordpress permissions of complete directory

cpanel > wordpress tool kit > Manage your site (Click on manage button) > Fix Permissions

It will fix all permissions of wordpress directory.

s3cmd : Configure multiple s3 buckets of multiple aws accounts on same server


First configure s3 bucket of 'AWS account - A' with s3cmd
s3cmd --configure
Add Access key and Secret Key of your 'AWS account A'.

Now rename ~/.s3cfg to ~/.s3cfg-first
You can find .s3cfg file in your home directory of logged in user.

Now configure s3 bucket of 'AWS account - B'
s3cmd --configure
Add Access key and Secret Key of your 'AWS account B'.
Now rename ~/.s3cfg to ~/.s3cfg-second

 
Configure third and so on

If you do not define config file parameter in command, it takes default config file i.e. .s3cfg


You need to define config file with command and you can communicate with different s3 buckets of one AWS account or multiple AWS accounts.
s3cmd ls s3://bucketname -c ~/.s3cfg-first
Above command will list the content of the defined s3 bucket of AWS account - A.
s3cmd ls s3://bucketname -c ~/.s3cfg-second
Similarly it will list the content of the defined s3 bucket of AWS account - B.

Now you can copy content, delete content or move them with different s3cmd commands.

Note : Number of buckets you can access of AWS account A or AWS account B, it depends on the privileges provided to access key and secret key and privileges are defined by the policy attached to the user whose access key and secret key you are using. 

If a policy which has read, write and list access of only one bucket 'Bucket-A' of an AWS account and this is the only policy attached to a user whose access key and secret key you are using then you can access only Bucket-A of that AWS account by using the access key and secret key of the user.

Use Redirect and Proxypass under one virtualhost in apache


If you need to redirect your domain on another domain or you need to redirect http to https, you use Redirect Permanent in your virtualhost to achieve but if your application is running on different port (node, python, ruby etc) and you have resolved port using proxy pass then your redirect attribute might not be working.

To solve this issue, use redirect under proxy directive.

<VirtualHost *:80>
    ProxyPreserveHost On
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

<Proxy *>
    Redirect permanent / https://domain.co.in
</Proxy>

</VirtualHost>

Now your port will be resolved with domain as well as you can redirect domain too.

/opt/lampp/bin/httpd: relocation error: .so: symbol SSL_library_init, version OPENSSL_1.0.0 not defined in file libssl.so.1.0.0 with link time reference

Xampp apache is not starting after adding stomp extension or mongo extension in php.ini file. After installation using pecl, you have added following line in php.ini file.
extension=mongo.so
extension=stomp.so

Now when you try to restart xampp, apache does not start. 

When you check the apache log, you see following error.

/opt/lampp/bin/httpd: relocation error: stomp.so: symbol SSL_library_init, version OPENSSL_1.0.0 not defined in file libssl.so.1.0.0 with link time reference

/opt/lampp/bin/httpd: relocation error: mongo.so: symbol SSL_library_init, version OPENSSL_1.0.0 not defined in file libssl.so.1.0.0 with link time reference

If you remove the extension line in php.ini, apache works fine but you need to use the extension so you can not remove it, here is the solution.

Solution :

Install stomp or mongo or other extension with disable ssl support


Choose no option while installing stomp/mongo/extension-name

OpenSSL install prefix (no to disable SSL support) [/usr] : no

Now when you add extension in php.ini, the apache works fine and you are able to use the installed extension.



XAMPP is currently only available as 32 bit application. Please use a 32 bit compatibility library for your system.

Solution - I
If you have latest 64 bit Linux Operating system like recent versions of Ubuntu / Debian / CentOS or Fedora and you want to use older version of php or mysql ( php 5.3 or php 5.4) then you should follow Solution - I.

Older libraries of xampp supports 32 bit operating system so your latest 64 bit operating system is not able to install older xampp.

To make it working install Ubuntu 12.04 LTS or Debian 7.0 in Vmware or Virtualbox
or 
Download ubuntu 12.04 docker image and install xampp inside it, it is faster solution and will not occupy too much RAM.

Solution - II
If your xampp was working fine and suddenly it has started giving this error then this solution is for you

Most common reason of this error, you have added an extension in xampp and after adding it in php.ini, the lampp is not getting started. You are getting following error :

XAMPP is currently only available as 32 bit application. Please use a 32 bit compatibility library for your system.

Here is the solution for you.

Comment following code in the file /opt/lampp/lampp

#case `uname -m` in
#    *_64)
#    if $XAMPP_ROOT/bin/php -v > /dev/null 2>&1
#    then
#        :
#    else
#        $GETTEXT -s "XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility library for your system."
#        exit 1
#    fi
#    ;;
#esac


Now restart xampp and you should not get above error.

If still there is error and it was because of new installed extension, I would suggest to comment the extension .so line in php.ini and restart xampp.

You can see the solution in the following video.
 


Error : pecl/pecl_http requires PHP (version >= 7.0.0), installed version is 5

Not able to install STOMP extension in XAMPP

Solution :

Current stable version of stomp is 2.0 which supports php 7.0, 
if we run

pecl install stomp
or
/opt/lampp/bin/pecl install stomp

it installs stomp-2.0 by default which needs php 7.0 so we need to install stomp which supports php 5.x,


Run :
pecl install stomp-1.0.9
or
/opt/lampp/bin/pecl install stomp-1.0.9

Stomp 1.0.9 is for php 5.x versions.
Now you should not get php version error.