Skip to main content

Posts

Showing posts from December, 2010

Webserver: Cron problem

After setting-up some cron jobs in my webserver, after checking the logs, I realised a Permission denied message.

The first thing that came to my mind, was that the user running the cron job with the error didn't have access to the file. This would awkward since the user cron job and the web-server user were the same.

I didn't find any solutions in the forums of the php framework I use, so I just googled it and stepped into this.

I read all the comments, and finally the solution came to me through glued2(10-15-2005, 09:08 PM) saying:
"call the php script with the same command as the cron script does (probably php -q /var/www/script.php)".
It was then that I undestood what was going on. I am mostly(if not completely) using debian-based linux OS, apache and php. By saying that, I falsely assumed that cron was going to "understand" that I was using a php file as a command and it should run php by its own.

To conclude, let's say I have cron file in /var/www…

Drupal: Status report problem: HTTP request status fails

Some of you may have encountered this problem in some cases. In "Status Report" page, accidentally appears the error below:

HTTP request status   FailsYour system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services.
What I did, was to recheck that my webserver had access to internet. Of course it had! The problem exists mostly when there is no information to resolve the domain name used with the local ip address of the webserver. This means that an error occurs in the entries of the DNS server.

In cases where DNS server is not existant(ex. local testing environment) all you have to do is inform the /etc/hosts file. For example if you use the domain http://www.example.local/ and your local ip addr…

Drupal: Custom module installation - hook_install() confusion

In Drupal, every module uses at least two files. The .info fileThe .module fileIf you are developing a custom module, you might also need a .install file, if you want to create or alter tables in database. Most modules use just one table so it will be difficult to understand what is wrong, in case you do what I did. Drupal has its own functions for database management. In no way mysql or pgsql functions must be used in a module. Drupal functions are everything you might need. Even if you find a function you need that only exists in mysql, try to create a port using drupal functions and php. It's the Drupal way and it is something you might benefit from later. A .install file uses at least three(3) functions.hook_schema()hook_installhook_uninstallIt's absolutely certain that creating the schema array won't be something difficult. Drupal core modules are more than great examples for this. In contrast to the words above, hook_install() and hook_uninstall can be sometimes c…

Drupal: Allow registrations through Invite or Referral modules only

The Invite module provides invitations from existing users to their contacts. The Referral module, in contrary, creates a special URL for each existing user, which can be found in each user's profile, and allows new user registration. Even though, these two modules seem to provide the same functionality, they don't (and they shouldn't). Invite module, provides a mechanism for a site administrator to limit new registrations to "Invitations only". Referral module doesn't provide any of this functionality. Some users have requested the Invite module and Referral module to join in one module. Until now, there isn't anything to that direction. Wouldn't it be great though if there was a solution to limit drupal registration to referral or invitation only? Copy the functions below to a refinvite.module file in your sites→all→modules→refinvite folder and enable the module. Then go to http://<your-address-here>/admin/user/settings and enable the new …