Current Planetary Positions PHP Web App Documentation

Current Planetary Positions PHP web app script

About

Current Planetary Positions is a web application that displays the positions of the sun, the moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, and Chiron in the zodiac signs at the current time. The columns display the planet’s name, the degree of zodiac sign, zodiac sign symbol, zodiac sign abbreviation, the minute of degree, the second of degree, and retrograde motion (if in retrograde). If there appears an ‘R’ in the last column, then that planet is in apparent retrograde motion.

It also displays the current local date and time as given by the viewer’s browser. The zodiac sign symbol icons are color-coded: red for fire signs, blue for water signs, green for earth signs, and yellow for air signs.

Current Planetary Positions uses the Swiss Ephemeris inside to get an accurate longitude of the planets/celestial bodies.

Requirements and Specs

Your server must have at least PHP 4.x installed. Your web host must allow file permissions be set (chmod 755). The app does this automatically, and works fine with most web hosts, but I have been alerted to at least 1 web host that blocks this. Also, your web host must allow the PHP exec() function.

Installation

  1. Unzip (extract) the .zip package file.
  2. Upload the current-planets folder to your website server.
  3. View the current planetary positions by navigating on your web browser to:
    http://yoursite.com/current-planets/current-planets.php

Languages

These languages are included in the Current Planetary Positions web app:

English (default)

Arabic

French

Current Planetary Positions web app is translation-ready, and includes a .pot file to make it easy for you to translate it into other languages. The numbers are also localized, and this supports right-to-left languages, as well.

How To Set The Language To Arabic

To set the language to Arabic:

  1. Open the file: current-planets.php.
  2. Line 40 should look like this:

    // $language = "ar_SA";
  3. Uncomment that line by deleting the two slashes at the beginning of the line.
  4. Save the file.

How To Set The Language To French

To set the language to French:

  1. Open the file: current-planets.php.
  2. Line 40 should look like this:

    // $language = "ar_SA";
  3. Uncomment that line by deleting the two slashes at the beginning of the line.
  4. On that same line, replace "ar_SA" with "fr_FR".
  5. Save the file.

How To Set To a Different Language

The languages included in the Current Planetary Positions web app are English (default), Arabic, and French. To set a different language, you’ll have to create the .mo and .po translation files for your desired language.

  1. Use the included .pot file to easily make your translation. You’ll find the file, currentplanets.pot, in the root directory of the app.
  2. Your .mo and .po translation files must be named exactly like this:

    currentplanets.mo
    currentplanets.po
    
  3. In the /locale/ directory, create a new directory named after your locale code. The locale is the two-letter language code, underscore, and two-letter country code. For example, for Spanish, you would name the directory “es_ES“. As another example, Moroccan Arabic would be “ar_MA“, while Libyan Arabic would be “ar_LY“. For the following steps, I will use Spanish as an example (“es_ES”).
  4. Inside the directory which you created in the previous step, create another directory named, “LC_MESSAGES” (all uppercase).
  5. Place your .mo and .po files inside your new “LC_MESSAGES” directory. Using Spanish as an example, the path to your files should look like this:

    current-planets/locale/es_ES/LC_MESSAGES/currentplanets.mo
    current-planets/locale/es_ES/LC_MESSAGES/currentplanets.po
    
  6. Now set your locale to Spanish. Open the file: current-planets.php.
  7. Line 40 should look like this:

    // $language = "ar_SA";
  8. Uncomment that line by deleting the two slashes at the beginning of the line.
  9. On that same line, replace "ar_SA" with "es_ES".
  10. Save the file.

Troubleshooting

All Positions Are Stuck On Aries

The app includes a file that must have permission to execute (CHMOD 755) in order to get the planetary positions from the Swiss Ephemeris. The file is:

current-planets/sweph/isabelse

The app sets this permission automatically. If all the positions are stuck on Aries, it means that your server did not allow the script to set file permissions to 755. If you feel comfortable with this, you can check this file’s permission on your server to be sure. You may manually have to set the permission to 755.

If you confirm that the file (current-planets/sweph/isabelse) has the proper permissions set to 755, and yet all the positions are still stuck on Aries, then it may be that your server does not allow scripts to execute using the PHP exec() function. If your web host blocks the PHP exec() function, then this app will not work on that server.

WordPress Alternative

The WordPress plugin version of this is available at WordPress.org.

License

License: GNU General Public License, version 2

Updated on February 17, 2017

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]