Showing posts with label LAMPS. Show all posts
Showing posts with label LAMPS. Show all posts

Thursday, September 17, 2009

Running Wordpress Locally and Editing with Netbeans

NetBeans
  1. Open Netbeans
  2. Tools>Plugins>Available tab
  3. Choose PHP plugin and install it
  4. File>New Project
  5. Expand the PHP Folder
  6. Choose PHP Project From Existing Source and press Next
  7. Find the root directory of your Wordpress files
  8. Give the project a name and import it
Debugging
  1. Install XAMPP as detailed in another post
  2. Point XAMPP's Apache to your Wordpress files by editing
    xampp\apache\conf\httpd.conf
  3. Search the document for htdocs -- there will be two occurences.
  4. Replace the two paths to point to your wordpress code.
Wordpress uses absolute URLs, so it will load pages from the internet if you try to view the local copy of Wordpress
So whenever you need to debug:
  1. Open your hosts file
  2. Add the following entry:
    127.0.0.1 your_domain_name
    (you can comment it out with a # at the beginning of a line)
  3. Start Mysql using XAMPP control panel
  4. Start Apache
  5. Point your browser at http://localhost

Wednesday, September 16, 2009

Move Your Wordpress Blog to XAMPP from a Webhost

Here it is, step by step:
  1. download XAMPP EXE installer (http://www.apachefriends.org/en/xampp-windows.html)
  2. install to a folder of your choice (I used c:\personal)
  3. XAMPP will be installed into c:\personal\xampp
  4. You will be asked some questions at the command line, choose as you wish... the final prompt will be a menu. Choice #1 is start control panel (1. start XAMPP Control Panel) or you can start via the Start>All Programs>XAMPP menu.
  5. type 1 and enter to start control panel
  6. start mysql (unblock if windows prompts)
  7. start apache (unblock if windows prompts)
  8. click the admin button next to mysql (this will open a new browser window)
Copying your PHP files from your web host
  1. download WinSCP
  2. you may have to configure FTP or SSH access with your webhost
  3. connect to your domain name with username/pass and download your wordpress files
  4. copy these files to ${XAMP__INSTALL_DIR}\htdocs
  5. Open wp-config.php
  6. Note down the username and password and database name
Exporting the DB
  1. Open PHPMyAdmin for your Webhost
  2. Select the database
  3. Select the Export tab
  4. Select the option to ZIP your export
  5. Select the option to export as SQL inserts
  6. Press Go
Creating a New DB and User
  1. Open PHPMyAdmin for your XAMPP install by pressing the Admin button in XAMPP control panel for MySQL
  2. At the top of the page, click the server level link
  3. Click the Privileges tab
  4. Click (in the middle of the page) Add a new User
  5. use same values for username,pass as your webhost
  6. Select the radio button "create database with same name and grant all privileges"
  7. Click "Go"
Importing the DB
  1. Open PHPMyAdmin for your XAMPP install by pressing the Admin button in XAMPP control panel for MySQL
  2. Click the databases tab
  3. Click your database
  4. Go to import tab
  5. Choose file, find the ZIP file you downloaded earlier
  6. Click "Go"
Open a web browser and navigate to http://localhost

Voila!

Here's how to create a DB without creating a user (though you'll have to sort out all the grants then!)
Near the bottom of the PHPMyAdmin page is 'Create new database'
Type in the name of the database your webhost has configured
Leave the drop down set to 'Collation'
Press create

Thursday, July 14, 2005

Installing Apache, PHP, and MySQL on Solaris

Apache

For Solaris:
  • Make sure gcc is installed along with the Sun developer packages and /usr/ccs/bin and /usr/local/bin are in the path.
  • To check whether the developer packages are installed, try 'pkginfo SUNWhea'. If it says package information not found, the packages are not installed.
If gcc is not installed:
  • Download the appropriate gcc package for your machine from sunfreeware.com.
  • Also download libiconv from sunfreeware.com
  • gunzip both
  • pkgadd -d filename for both gcc and libiconv - if you get an error about no space left on the device or unable to unpack datastream, scroll down further for a resolution.
  • pkginfo SUNWhea
    (This is one of the developer packages)
  • The Sun developer packages need to be installed and
    /usr/ccs/bin and /usr/local/bin must be in the path.
    # export PATH=$PATH:/usr/ccs/bin:/usr/local/bin

  • Links:
    http://www-uxsup.csx.cam.ac.uk/install/solaris/pkginst.html

    http://people.arsc.edu/~clark/sun/PkgAnalyze.html

  • If the developer packages are not installed, put the Solaris 9 cd in. Go to /cdrom and navigate the mess until you find the directory Product. Then type the following:

    # pkgadd -d . SUNWhea
  • Remember, you can check whether a package is installed by typing pkginfo pkgname

  • For gcc, install SUNWhea, SUNWsprot, SUNWlibm, SUNWbtool, SUNWarc (but I'm not sure if you need the last one).

If pkgadd fails with "unable to unpack datastream" and "No space left on device"
  • pkgadd -d gcc... fails with the following:

The following packages are available:
1 SMCgcc342 gcc
(sparc) 3.4.2

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 1

Processing package instance from

gcc
(sparc) 3.4.2
cpio: Cannot write "reloc/include/c++/3.4.2/sparc-sun-solaris2.9/bits/stdc++.h.g
ch/O2g", errno 28, No space left on device

...

pkgadd: ERROR: attempt to process datastream failed
- process failed, exit code 24
pkgadd: ERROR: unable to unpack datastream

Installation of failed (internal error).
No changes were made to the system.

  • A df -k shows enough free space on the destination slice.
  • This means that /var is being filled up as pkgadd extracts into /var/tmp. The following page details this:
Links:
http://www.brandonhutchinson.com/No_space_left_on_device_when_installing_packages.html

  • The steps to take are as follows:
  • # pkgtrans packagename /path/to/large/file/system
  • # pkgadd -d /path/to/large/file/system
  • If it prompts you to install the package again after "Installation successful", just CTRL-C back to the prompt.
  • Then
    # rm -rf /path/to/large/file/system/$PGKNAME where pkgname=SMCgcc342 in this example

For SuSE:
I ran into a problem with some library missing but I forget which. I found an RPM however.

  • Unzip/untar tar zxvf httpd-* and cd http-*
  • ./configure --enable-so --enable-cgi --enable-ssl
Hopefully this works.

Links:
http://dan.drydog.com/apache2php.html


More Apache

  • make
  • make install
  • edit httpd.conf and set the servername
  • for solaris 9, set Group to nobody!

  • # Make sure there's only **1** line with this directive:
    LoadModule php4_module modules/libphp4.so

  • # Add index.php to your DirectoryIndex line:
    DirectoryIndex index.html index.php

# Uncomment one of the following (but not both)
# Use for PHP 4.x:
AddHandler php-script php
# Use for PHP 5.x:
#AddHandler php5-script php

AddType text/html php

# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phps

PHP

  • gunzip php
  • ./configure --with-apxs2=/usr/local/apache2/bin/apxs --prefix=/usr/local/apache2/php --disable-cgi --with-mysql
if you get an error about libgcc_s.so.1
export LD_LIBRARY_PATH=/usr/local/lib

or whatever the path you have on your machine
  • # cp -p php.ini-recommended /usr/local/apache/php/php.ini

MySQL

Initialize the database:
  • copy over your database

    -or-
  • if you are not importing an existing database, the database needs to be initiliazed using the configure script or mysql_install_db in $mySQL/bin
  • groupadd mysql
  • useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false mysql
  • chown -R mysql:mysql /usr/local/mysql
  • run using /mysqld --user=mysql &

Dumping an Existing MySQL database
mysqldump --user=blar --password=barf DBNAME > DBDUMP.sql

Loading the dump into MySQL
mysql --user=blar --password=barf < DBDUMP.sql

Dump the mysql database if you want user information to be transferred as well.

XRMS and phpMyAdmin

Set of both of these is fairly straight forward. Just untar xrms and phpmyadmin inside apache's document root, in this case in /usr/local/apache2/htdocs.

Modify vars.php for XRMS.

phpMyAdmin also has an ini file in its directory, which is commented well.

Labels

Blog Archive

Contributors