Username: Save?
Password:
Home Forum Links Search Login Register*
    News: Keep The TechnoWorldInc.com Community Clean: Read Guidelines Here.
Recent Updates
[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[February 14, 2024, 02:00:39 PM]
Subscriptions
Get Latest Tech Updates For Free!
Resources
   Travelikers
   Funistan
   PrettyGalz
   Techlap
   FreeThemes
   Videsta
   Glamistan
   BachatMela
   GlamGalz
   Techzug
   Vidsage
   Funzug
   WorldHostInc
   Funfani
   FilmyMama
   Uploaded.Tech
   MegaPixelShop
   Netens
   Funotic
   FreeJobsInc
   FilesPark
Participate in the fastest growing Technical Encyclopedia! This website is 100% Free. Please register or login using the login box above if you have already registered. You will need to be logged in to reply, make new topics and to access all the areas. Registration is free! Click Here To Register.
+ Techno World Inc - The Best Technical Encyclopedia Online! » Forum » THE TECHNO CLUB [ TECHNOWORLDINC.COM ] » Programming Zone » PHP
  PHP File Executeable
Pages: [1]   Go Down
  Print  
Author Topic: PHP File Executeable  (Read 1017 times)
Daniel Franklin
TWI Hero
**********


Karma: 3
Offline Offline

Posts: 16647


View Profile Email
PHP File Executeable
« Posted: September 26, 2007, 11:07:50 AM »


ill some packages

aptitude install php4 postgresql libapache2-mod-auth-pgsql
php4-pgsql php4-cli

Make PHP File

vi runphp.php

Add this line to the first line

#!/usr/bin/php4

And make you own script with PHP Syntax. You can see my example file here (rename it from .txt to .php). This file doing this following actions:

    * Connect to database (PostgreSQL).
    * Get some data from database.
    * Determine cost variable from that data with some function.
    * Insert usefull new data into another table.

Make It Execuable

Make sure this php file can be execuate by:

chmod +x runphp.php

Get Error?

First time I run this file, I get this following error:

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: ....

Don't worry, this error can be happen because by default PostgreSQL support for php4 in Debian is not enabled yet in the configuration for the Apache2 SAPI. Cheesy So type this command:

dpkg-reconfigure php4-pgsql
/etc/init.d/apache2 restart

That error should be fixed.

Run This File

Just type this command

./runphp.php

Well done and Good Luck

--

me, sUpricak3p
Articles Source - Free Articles

Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Copyright © 2006-2023 TechnoWorldInc.com. All Rights Reserved. Privacy Policy | Disclaimer
Page created in 0.099 seconds with 24 queries.