The ModMyTM Family of Sites:
ModMyMotoModMyiModMyGphone




 
 
Register or Connect with Facebook

Discuss AppStore Apps | Browse / Search Cydia | MMi Cydia Stats




  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > Native iPhone / iPod Touch App Discussion
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 09-16-2007, 03:34 PM
Green Apple
 
Join Date: Sep 2007
Posts: 32
Thanks: 3
Thanked 1 Time in 1 Post
Using PHP and Apache

There is both Apache and PHP available for the iPhone. Does anyone know how to set this up all the way so that you can run PHP on the installed Apache server?

Currently I can install both. Get to http://localhost/ and put pages there. But how do you get PHP to run on there? After installation of PHP, a message prompts you to create '/opt/iphone/bin/' in '$path' (I think that is correct). I am not sure how to create this, I am thinking something to do with using a terminal client or maybe SSH into the iPhone?

After the creation of that directory, does PHP then run on the Apache server?

I would think that the possibilities to create local running applications would be great! Including maybe a simple wiki using XML! I would guess that running MYSQL or something to that effect would really cause performance issues, but who knows.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #2  
Old 09-21-2007, 06:59 AM
What's Jailbreak?
 
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Quote:
Originally Posted by Zacko View Post
There is both Apache and PHP available for the iPhone. Does anyone know how to set this up all the way so that you can run PHP on the installed Apache server?

Currently I can install both. Get to http://localhost/ and put pages there. But how do you get PHP to run on there? After installation of PHP, a message prompts you to create '/opt/iphone/bin/' in '$path' (I think that is correct). I am not sure how to create this, I am thinking something to do with using a terminal client or maybe SSH into the iPhone?

After the creation of that directory, does PHP then run on the Apache server?

I would think that the possibilities to create local running applications would be great! Including maybe a simple wiki using XML! I would guess that running MYSQL or something to that effect would really cause performance issues, but who knows.
Yeah - I have exactly the same problem with PHP and Apache. I've been looking at the Apache httpd.config file and trying to put in the directives for the PHP path etc - but as yet no joy. Does anyone know how to do this or where we can find documentation on getting php up and running on the iphone?

Here's what I added to the end of the .config:


php_value include_path ".:/opt/iphone/bin/"
php_admin_flag safe_mode on


php_value include_path ".:/opt/iphone/bin/"
php_admin_flag safe_mode on


php3_include_path ".:/opt/iphone/bin/"
php3_safe_mode on


Still no php!

Thanks
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #3  
Old 09-21-2007, 08:28 AM
Green Apple
 
Join Date: Sep 2007
Posts: 32
Thanks: 3
Thanked 1 Time in 1 Post

Thanks for sharing my request and needs!

I think running local PHP sites would be awesome! The first thing I would do is create a much better RSS feed reader (similar in function to the Digg one for iPhone). Also, I would love to implement a personal wiki that is iPhone friendly and I could back up. Being able to access HTML files and PHP files would be great! Of course being able to run some sort of database would really increase functionality, but I would settle for using XML.

Let's hope someone can help us out!

THX
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #4  
Old 09-30-2007, 03:38 PM
What's Jailbreak?
 
Join Date: Sep 2007
Posts: 22
Thanks: 0
Thanked 1 Time in 1 Post
Apache modules not enabled?

As far as I can tell external modules are not enabled on the precomplied Apache install available in installer. Turning modules on is a compliation option.

I was setting up the httpd.conf file to load the PHP modules and got the error

"Invalid command 'LoadModule', perhaps mis-spelled or defined by a module not included in the server configuration"

you can read about it on this page http://www.vttoth.com/loadmod.htm

So this appears not to be a configuration issue. Apache works fine locally and I can make HTML pages to view on 10.0.1.x, just no PHP ... yet...
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #5  
Old 10-01-2007, 11:34 AM
Green Apple
 
Join Date: Sep 2007
Posts: 32
Thanks: 3
Thanked 1 Time in 1 Post

Thanks for the update! I too can run HTML files no problem, but I wouldn't know where to begin to enable PHP to run. I guess the question is: Why is PHP available as a download if you can't run it? and, How are people using the other available ones (Ruby, Python, etc)?

thx
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #6  
Old 10-01-2007, 12:33 PM
What's Jailbreak?
 
Join Date: Sep 2007
Posts: 22
Thanks: 0
Thanked 1 Time in 1 Post

Enabling PHP should not be all that complicated, there are a few lines you add to the httpd.conf file. LoadModule, AddModule, AddType. If you read the notes in the httpd.conf file, you will see the locations where you add the lines. PHP, Perl, and other modules may be enabled at runtime in this manner, simply requiring a soft restart of the webserver.

You can find documentation on the web for the syntax of these entries, which vary per platform (windows, OSX, for example, use slightly different filenames.)

I had located where the PHP files were on the iphone (opt/iphone/bin) and had attempted to load that as a module (the version is PHP 5.x...).

This is where I ran into the error mentioned above, seemingly that the Apache install provided does NOT have module support compiled in.

Next step would probably be to contact the folks who provided the install, and request a version with dynamic module support enabled. My intuition tells me just downloading an uncompiled version of Apache and attempting to compile it on the iPhone would not work...
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #7  
Old 10-10-2007, 02:14 PM
Green Apple
 
Join Date: Sep 2007
Posts: 44
Thanks: 2
Thanked 1 Time in 1 Post
Answer to PHP in Apache

Source:
Chinese Found:
http://blog.ilovo.com

Google Translated:
http://translate.google.com/translat...language_tools

Step1:
Install Apache and PHP using Installer.app

Step2: (follow the guide below)
IPHONE PHP configuration in the environment

open the document for editing / etc / httpd / httpd.conf file, search ... .. , in this intermediate type:


ScriptAlias /php /opt/iphone/bin
AddType application/x-httpd-php .php
Action application/x-httpd-php “/php/php-cgi”


Then edit /etc/profile document, the path to PHP foisted PATH:

PATH = "/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:/opt/iphone/bin"


Resuming APACHE servers through SSH command (in WINSCP) input: apachectl restart

enjoy it. Enjoy it.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #8  
Old 10-10-2007, 07:18 PM
Green Apple
 
Join Date: Sep 2007
Posts: 32
Thanks: 3
Thanked 1 Time in 1 Post

Wow, nice find. Have you done this? Do you know if it works? To be honest with you, its a bit over my head. I program PHP and other web based markup/programming languages, so I usually leave the config stuff to the Admins However, I may just give it a try and hope I don't end up with a Restore scenario.

Thanks for the find, top notch. Chinese, who knew?!
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #9  
Old 10-13-2007, 09:06 PM
What's Jailbreak?
 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
PHP APACHE configuration iPod touch

Take a look at:

http://www.touchdev.net/wiki/PHP_APA...ion_iPod_touch

Tested on iPod Touch 16GB

Attached: My working httpd.conf & profile files.
Attached Files
File Type: zip files.zip (12.1 KB, 111 views)
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #10  
Old 12-23-2007, 12:01 PM
What's Jailbreak?
 
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Hi,
maybe i am blnd, but i can't find the file etc/proflie:-(
is there another way to run php?

greetings
dutchy
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #11  
Old 01-12-2008, 11:19 AM
Nefarious's Avatar
iPhone? More like MyPhone
 
Join Date: Nov 2007
Device + Firmware: Iphone 3G 16GB White
Operating System: Windows 7 Ultimate
Posts: 239
Thanks: 23
Thanked 18 Times in 17 Posts

Just what I was looking for. Worked like a charm.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #12  
Old 01-22-2008, 10:19 AM
What's Jailbreak?
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I did this:
Quote:
Step1:
Install Apache and PHP using Installer.app

Step2: (follow the guide below)
IPHONE PHP configuration in the environment

open the document for editing / etc / httpd / httpd.conf file, search ... .. , in this intermediate type:

ScriptAlias /php /opt/iphone/bin
AddType application/x-httpd-php .php
Action application/x-httpd-php “/php/php-cgi”

Then edit /etc/profile document, the path to PHP foisted PATH:

PATH = "/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:/opt/iphone/bin"
But then i try open script error occured(Internal Server Erorr: The server encountered an internal error or misconfiguration and was unable complite your request).
I have 1.1.2 firmware, Apache ver: 1.3.37-2, PHP: 5.2.3-2.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #13  
Old 05-05-2008, 08:48 PM
What's Jailbreak?
 
Join Date: Apr 2008
Device + Firmware: iPhone 16 1.1.4
Operating System: win xp home sp2
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
what about cURL?

Running PHP is cool, but I'm trying to find a way to enable PHP to use cURL. Anyone got any idea? cURL seems to be working fine from the terminal, so it's only a matter of configuration. In Windows I used the php.ini but here is more complicated.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
Reply

  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > Native iPhone / iPod Touch App Discussion

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



Go to Top
ModMyI

All times are GMT -6. The time now is 10:05 PM. Powered by vBulletin® Version 3.8.4
If you need Dedicated Server Hosting, you should check out SingleHop. | Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 Copyright © 2007-09 by ModMy, LLC. All rights reserved.

iPhone News / iPhone Forums / Apple News / Apple Forums / RSS / Contact Us / / Privacy Statement / Top