| | |
How to test PHP code in offline in Linux + Apache 2
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2005
Posts: 14
Reputation:
Solved Threads: 0
Dear all members,
I have a problem . As i use dial up network as a mean to get to the internet it is some times costly to upload my code to internet and then test . As i am learning PHP recently , if any body suggest any way to run my PHP code in ofline mode then it will be helpfull.
I have tested running from "localhost.localdomain" or "192.0.0.1" but got error that "localhost" can not be connected.
I have the following specifications: :!:
1. Fedora core 3
2. Apache 2.0.54
3. PHP 5.0.4
4. MySQL
I have a problem . As i use dial up network as a mean to get to the internet it is some times costly to upload my code to internet and then test . As i am learning PHP recently , if any body suggest any way to run my PHP code in ofline mode then it will be helpfull.
I have tested running from "localhost.localdomain" or "192.0.0.1" but got error that "localhost" can not be connected.
I have the following specifications: :!:
1. Fedora core 3
2. Apache 2.0.54
3. PHP 5.0.4
4. MySQL
•
•
•
•
Originally Posted by thandermax
Dear all members,
I have the following specifications:
1. Fedora core 3
2. Apache 2.0.54
3. PHP 5.0.4
4. MySQL
On the local machine, is the httpd (Apache) service started? Is the mysqld service started? Have you created a database? Have you configured /etc/php.ini yet?
Theres no such thing as running php in "offline mode". All you do is changing some variables to the apache's conf file to be run in localhost...
Basically, install apache on your machine, and then configure this directive
ServerName 127.0.0.1
(And obviously, configure it to have support for php, google for it)
Also, If you need to access a DB, you need to install it in your machine, that way, you have a full local development environment, and wont need to connect to internet anymore...
You say you get an error that localhost cannot be connected, it means
"Sorry, but theres no application running at port 80", aka, theres no webserver installed (or started in case you already installed it)
Basically, install apache on your machine, and then configure this directive
ServerName 127.0.0.1
(And obviously, configure it to have support for php, google for it)
Also, If you need to access a DB, you need to install it in your machine, that way, you have a full local development environment, and wont need to connect to internet anymore...
You say you get an error that localhost cannot be connected, it means
"Sorry, but theres no application running at port 80", aka, theres no webserver installed (or started in case you already installed it)
![]() |
Similar Threads
- Apache (Linux Servers and Apache)
- php script displays the source code on invokation (PHP)
- PHP 5 - Over before it began (PHP)
- [JOB] Web Developer - Linux, Apache, MySQL, PHP | D.C. (Web Development Job Offers)
- Apache2 displaying PHP5 source code (PHP)
- I had a experience of a website coded in PHP (PHP)
- My embedded php code won't execute (PHP)
Other Threads in the PHP Forum
- Previous Thread: Need Help Creating an ad to hire a programmer for DBs
- Next Thread: Limitations of Moveable Type for newbies
| Thread Tools | Search this Thread |
# .htaccess 5.2.10 access alexa apache api array beginner broken cakephp checkbox class clean clients cms code convert cron curl database date directory display dissertation dropdown dynamic echo$_get[x]changingitintovariable... email encode error fairness file folder form forms function functions google hack href htaccess html htmlspecialchars image include indentedsubcategory ip javascript joomla legislation limit link local login mail memberships menu methods multiple multipletables mysql mysqlquery network newsletters oop open passwords paypal pdf persist php provider query radio random redirect remote script search secure server sessions simple sockets source space spam sql system table tutorial upload url user variable video voteup web youtube





