FireStats error : Database error: INSERT command denied to user 'dbo244183939'@'74.208.16.197' for table 'wp_firestats_pending_data'

MySQL Version: 5.0.81-log
SQL Query:
INSERT DELAYED INTO `wp_firestats_pending_data` ( `timestamp`, `site_id` , `url` , `referrer` , `useragent` , `ip`, `type` ) VALUES ( NOW(), '1', 'http://www.pinoytux.com/tag/php', '', 'CCBot/1.0 (+http://www.commoncrawl.org/bot.html)', '38.107.191.86', NULL )
Browsing all articles tagged with php
Aug
14

How to Fix PECL PHP Error: /bin/sh: bad interpreter: Permission denied

I recently tried installing xdebug on a RHEL 4 machine, and somehow, the server decided that it should refuse having xdebug installed. As if running a heavy Java app is not enough, I decided to add more processes for the server to run. And it looks like the server has got me:

[root@server src]# pecl install xdebug
downloading xdebug-2.0.5.tgz ...
Starting to download xdebug-2.0.5.tgz (287,621 bytes)
.............done: 287,621 bytes
12 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
/usr/local/bin/phpize: /tmp/pear/temp/xdebug/build/shtool: /bin/sh: bad interpreter: Permission denied

So, like I always do, I tackle the problem with my handy tool: Google. I found out that this error occurs when /tmp is mounted as read-only (ro). You can check this by looking at the /etc/fstab file and check the /tmp partition.

Okay, now I know what the problem is. How do I get over this?

Lazy that I am, I moved the /tmp/pear directory, and create a symlink to the root directory.

[root@server src]# mv /tmp/pear /tmp/pear-ori
[root@server src]# mkdir /root
[root@server src]# ln -s /tmp/pear /root/tmp/pear

Now that the directory from where the PECL scripts are running is in /root, the installation should go smoothly.

Another way to go around this is to remount the /tmp:

[root@server src]# mount -oremount,exec /tmp

I have not tried the above command because I thought that creating symlink is a safer approach rather than messing with the mounts.

If there are other ways to fix this, let me know using the comment box below.

Jun
15

PHP JSON Module Bug Fix

If you are encountering any weird stuff with your PHP-JSON module installation, you might want to reinstall JSON using this link, this might get rid of the bug that is pestering you and your application.

First, uninstall any previous JSON installation you have so as not to conflict with the new one. To make sure you got the old JSON out, check your list of PHP modules by running:

php -m

JSON should not be listed and make sure you do not see any errors either. Doing this will prevent further headaches, trust me.

Perform the following steps to install the bug-free version of JSON from source:

1. Download the JSON source from here. You can use wget to download the source if you are using CLI

wget http://aurore.net/projects/php-json/php-json-ext-1.2.1.tar.bz2

2. Uncompress the archive and change directory.

tar jxf php-json-ext-1.2.1.tar.bz2
cd php-json-ext-1.2.1

3. Run phpize. Make sure that phpize is installed before proceeding to this step. phpize is included in the php-devel package.

phpize

4. Configure, make and make install

./configure
make
make install

JSON is now installed, but make sure that json.so is loaded in your php.ini file.

1. Open php.ini file. If you are unsure about the location of your php.ini file, run

php -i | grep php.ini

You should see something like this:

Loaded Configuration File => /etc/php.ini

2. Add this at the last line of the configuration file:

extension=json.so

3. You might want to restart Apache to make sure everything is still working.

To check if JSON is loaded as module, run php -m again, make sure JSON is in the list.

Now, to test JSON, open an editor and copy these lines:

< ?php
$input = '{ "test" : 12121211212121 }';
$val = json_decode($input, true);
print $val["test"];
?>

Save the file (json-test.php is the filename in this case).

Execute the file by running php json-test.php

The result should be 12121211212121

Jun
7

Fix Fatal error: Allowed memory size of 8388608 bytes exhausted

I was installing xdebug a few days back to one of the production servers when I encountered this beautiful error message:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 143 bytes) in /usr/share/pear/PEAR/PackageFile/v2/Validator.php on line 1608 Allowed memory size of 8388608 bytes exhausted (tried to allocate 64 bytes)

So my instinct tells me to look inside the php.ini file and find for this line:

memory_limit = 12M

The server’s php.ini file is already set to 256M so I should go look for something else. Luckily, I found this tip from www.agileapproach.com.

Open the file /usr/share/pear/pearcmd.php and add this right after the < ?php line:

@ini_set('memory_limit', '16M');

That should fix the “Fatal error: Allowed memory size” error. I can now resume installing xdebug without any errors.

The reason why editing the php.ini will not fix the issue is because PECL/PEAR does not use the PHP settings, so the PEAR settings needs to be adjusted.

Hope this helps.

Apr
21

Tip: Testing Your PHP/MySQL Connection

How to test if PHP connects to MySQL database?

There are numerous times when I have to setup Apache and PHP on a freshly installed Linux server. Considering that not only that Apache service should work, I also have to make sure that PHP and MySQL are working properly together.

Forgetful that I am, I always tend to forget what components should I have to make PHP and MySQL talk to each other. You need something like a ’special glue’ to connect the two together and I will discuss here how to make PHP and MySQL work together for both RPM and source installation.
read more

Mar
4

Why Should We Take Trainings?

For the past few days, I have been thinking of enrolling myself to one of the available trainings for Red Hat Certified Engineer (RHCE) courses in Manila. Of course knowing myself, it would take me at least six months decide whether I should go with the training or not. I am also thinking if I am truly prepared for this kind of training, physically, mentally and financially.There are also a few types of trainings that can enhance our life not only with our careers but also on a personal side. There are technical trainings, management trainings, personality trainings (good for aspiring models or spokespeople) and more.

Certifications from prestigious enterprise companies like Red Hat Enterprise or CISCO is definitely a plus to anyone’s profile, providing bigger chances of getting that dream career. But, if totally unprepared, trainings and examinations can break your self-esteem, not to mention your bank. CISCO trainings at Mapua Insitute of Technology can take at least a year and may cost around Php30,000 to complete the four modules. I have taken technical training myself these past few years. The first one I had was Linux System Administration at Meralco Foundation which has definitely paved the way for me to become a Linux System Administrator. The training was OK and the lessons we had back then was very basic and the cost is really cheap. I learned a lot of things during my Linux training and I still use the notebook with my ‘newbie’ notes in it.

The next one I had was PHP-MySQL training with same institution. It is also OK, as we started with very basic modules and went on to more challenging case studies. This was a hard for me because this was the time I had to skip school because my father is already very sick. Nonetheless, I finished the final case study just in time.

Now going back to RHCE training, there is no doubt that being an RHCE attracts employers like moths to light. But this one puts really hard pressure on me. Php22,000 for an examination is a huge money and failing is not an option unless I earn Php2M a year. I also need to undergo another type of technical training for my personal use: driving lessons :) . So time management is a big factor here.

In the end, it all boils down to one: training is a very good investment and though it may be costly at first, the rewards are definitely great.

*Sigh*

Powered by 1and1.comGlobat Webhosting Earn with Your BlogAdvertise @ PinoyTux

Search PinoyTux

Subscribe to Email Feeds

Enter Email Address:

Blog Lounge

Popular Posts

Recent Posts

Drop your Card Here

Recent Comments

Site Stats