Results 1 to 9 of 9

Thread: Unable to work on PHP

  1. #1
    Join Date
    Apr 2006
    Beans
    140

    Unable to work on PHP

    Hi All,

    I used synaptic manager to install PHP. I selected PHP and other related processes and loaded(installed) them and I wanted to work on it I can't see where it is installed.

    Please help with steps to install and work on PHP.

    Thanks in advance,

    Swaroop Kunduru.

  2. #2
    Join Date
    Jan 2006
    Location
    Leuven, Belgium
    Beans
    3,414

    Re: Unable to work on PHP

    PHP isn't a program you can start, it's a kind of scripting language to render websites. So to use it you'll need to write a php script in a text editor and save it as index.php in the root of a webserver (e.g. apache which is in the repos) and then open the page in a webbrowser.

    There are plenty of tutorials on php scripts on the net, do a search through google or something to find out more.

  3. #3
    Join Date
    Apr 2006
    Beans
    140

    Re: Unable to work on PHP

    Hi Ramses de Norre's ,

    Thanks for your time to answer my question. I went to www.w3schools.com and copied PHP scripts in html code and named the file as index.php. I am using Tomcat to deploy, in tomcat webserver webapps I created the webapplication structure and stored this index.php.

    The page when deployed it was O.K but when I called from browser I got a blank screen.

    There is something I am missing in PHP, is it a PATH or LIB Path? I don't know. Some one Please help.

    Thanks in advance.

    Regards,

  4. #4
    Join Date
    Nov 2006
    Location
    Mumbai, India
    Beans
    186
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Unable to work on PHP

    You have to put your PHP scripts in your web document root.

    eg. If you have Apache installed, find the 'htdocs' directory and put all your PHP scripts in there... and access them via http://localhost.

    I have XAMPP installed so I don't know where the directory would be if you got Apache through apt. For me it is /opt/lampp/htdocs.

  5. #5
    Join Date
    Mar 2006
    Location
    Toronto, Canada
    Beans
    855

    Re: Unable to work on PHP

    LAMP (aka PHP) allows you to install a CMS, which are these great web portals to giant apps that allow you to manage lots of data/information:
    http://www.opensourcecms.com/

    Here's all you need to get LAMP to work with a CMS:

    Apache2/PHP4/MySQL4 (breezy or dapper):
    Code:
    sudo apt-get install apache2 php4 mysql-client mysql-server phpmyadmin libapache2-mod-php4 libapache2-mod-auth-mysql php4-mysql
    Apache2/PHP5/MySQL4 (breezy or dapper):
    Code:
    sudo apt-get install apache2 php5 mysql-client mysql-server phpmyadmin libapache2-mod-php5 libapache2-mod-auth-mysql php5-mysql
    Apache2/PHP5/MySQL5 (dapper):
    Code:
    sudo apt-get install apache2 php5 mysql-client-5.0 mysql-server-5.0 phpmyadmin libapache2-mod-php5 libapache2-mod-auth-mysql php5-mysql
    Reboot (or start mysql manually).

    Open phpmyadmin:
    http://localhost/phpmyadmin

    Name: root
    Pass: [blank]

    -----------------------------------------------------------------------------

    For Apache2/PHP-latest/MySQL-latest, install XAMPP:
    http://www.ubuntuforums.org/showthread.php?t=223410
    Last edited by adamkane; December 3rd, 2006 at 10:02 AM.

  6. #6
    Join Date
    Nov 2006
    Location
    Mumbai, India
    Beans
    186
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Unable to work on PHP

    Quote Originally Posted by adamkane View Post
    LAMP (aka PHP) allows you to install a CMS, which are these great web portals to giant apps that allow you to manage lots of data/information:
    http://www.opensourcecms.com/

    LAMP is not an alias for PHP. It stands for Linux, Apache, MySQL and PHP.

    Also, installation of any of these "services" has nothing to do with a CMS.... a CMS is just a web application usually working with PHP/MySQL.

  7. #7
    Join Date
    Apr 2006
    Beans
    140

    Re: Unable to work on PHP

    Hi All,

    Thankyou to all of you for spending your time.

    I gave the command and got the result below.

    swaroop@swaroop-laptop:~$ sudo apt-get install apache2 php5 mysql-client-5.0 mysql-server-5.0 phpmyadmin libapache2-mod-php5 libapache2-mod-auth-mysql php5-mysql
    Password:
    Reading package lists... Done
    Building dependency tree... Done
    php5 is already the newest version.
    mysql-client-5.0 is already the newest version.
    mysql-server-5.0 is already the newest version.
    E: Couldn't find package phpmyadmin
    swaroop@swaroop-laptop:~$


    Please let me know what should I do to fix it.

    Regards,

    Swaroop Kunduru.

  8. #8
    Join Date
    Jun 2006
    Location
    CT, USA
    Beans
    5,267
    Distro
    Ubuntu 6.10 Edgy

    Re: Unable to work on PHP

    Quote Originally Posted by Verminox View Post
    LAMP is not an alias for PHP. It stands for Linux, Apache, MySQL and PHP.
    Not exactly. P stands for: PHP, Perl, or Python

  9. #9
    Join Date
    Jan 2005
    Location
    South Africa
    Beans
    2,098
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Unable to work on PHP

    How do you want to use PHP? For a webserver or for plain scripting (both is possible).

    Let's assume webserver.

    Quote Originally Posted by SwaroopKunduru View Post
    E: Couldn't find package phpmyadmin
    You normally don't need that package for a webserver.

    Once everything is installed (and it seems to be), start your browser and connect to http://localhost. You should see some apache information.
    Does it work?
    If so, create a file phpinfo.php containing the following code:
    PHP Code:
    <?php
    phpinfo
    ();
    ?>
    and store it in the webserver document root (I use slackware as a webserver and don't know where the default webserver document root is in Ubuntu).
    In the browser, use the url http://localhost/phpinfo.php
    You should now see information about PHP.
    Does it work?

    If something does not work, tell us where it fails and someone can point you in the right direction.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •