Tag: Linux


Plesk and PHP’s open_basedir restriction

When you get a fatal error from PHP which is saying that the open_basedir restrictions are in place it simply means that it’s not possible to include or open files outside these directories.

However, this can be solved by changing the ‘open_basedir‘ ini using the ini_set() function or when you’re hosted on a Plesk server by creating a vhost.conf file in the conf directory using the following contents:

<Directory VHOST_DIR/httpdocs>
php_admin_value open_basedir "VHOST_DIR/httpdocs:/tmp:VHOST_DIR/ADD_DIR"
</Directory>

Change VHOST_DIR to the directory of your domain, and ADD_DIR to the directory you wish to add. After this run the following command to reload the configuration for the webserver.

/usr/local/psa/admin/sbin/websrvmng -v -a

However, chances are that this is not possible for your account at which point you have to ask your hoster to either disable or add the directory the open_basedir directive for your account.


Installing .deb files on Debian and Ubuntu

On Debian and Ubuntu (that’s because Ubuntu is based on the Debian distribution) you can use apt-get to install or update applications on your Linux machine. However, sometimes you’ll have to download a .deb file or you get one from a CD-rom or other media.

To install a .deb file you need to be the root user of the box and use the dpkg command.

dpkg -i filename.deb

Dpkg can also be used to:

  • dpkg –unpack: unpacks the file but doesn’t install it
  • dpkg –configure: shows the configuration options which are available for the package
  • dpkg –remove: removes (uninstall) a package from the system

To get more information from a package file (such as the version of the application) you can use the dpkg-deb command in the following way:

dpkg-deb –show filename.deb

Even more (less used) commands can be found in the manual pages of the dpkg command.


Enabling SSL support in cURL

In some occasions the cURL package may be installed but PHP still reports an error saying something that cURL is installed but without SSL support compiled into it. If your server has OpenSSL installed (look for it by issuing the whereis openssl command) you should download and/or recompile the libcurl package with the following commands;

./configure --with-ssl
make
make install

You probably need to be root when doing the last command (make install).

Now, when you restart Apache, PHP should be able to use SSL connections to other sites without any problems!


Debian, Oracle XE and PHP(5)

Oracle can be a real pain to get installed on your server, however, since they’ve created a Debian (Sarge and later) repository it is a lot easier. Getting it to work with PHP (in this case version 5) will be another story which this small how-to will describe.

First, add the Debian repository to your /etc/apt/sources.list by adding the following two lines at the bottom of the file;

# Oracle XE
deb http://oss.oracle.com/debian unstable main non-free

Afterwards run the following chain of commands as root;

wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | apt-key add -
apt-get update
apt-get install oracle-xe

Now Oracle is installed on your system and it will ask you to run /etc/init.d/oracle configure first.
Since this was the easy part let’s continue to the hard part; enabling Oracle in PHP. (continue reading…)


Linux tip

Zoeken op tekst in bestanden in Linux:

find -type f -print0 | xargs -r0 grep -F 'HIER JE TEKST'

Meer handige commando’s vind je op Pixelbeat.org


Copyright © 1996-2010 Re:morse.nl. All rights reserved.
iDream theme by Templates Next | Powered by WordPress