The ModMyTM Family of Sites:
ModMyMotoModMyiModMyGphone




 
 
Register or Connect with Facebook

2.2 Unlock / Jailbreak OS X | 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 (permalink)  
Old 09-16-2007, 02: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 (permalink)  
Old 09-21-2007, 05: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 (permalink)  
Old 09-21-2007, 07: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 (permalink)  
Old 09-30-2007, 02: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 (permalink)  
Old 10-01-2007, 10: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 (permalink)  
Old 10-01-2007, 11:33 AM
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 (permalink)  
Old 10-10-2007, 01:14 PM
Green Apple
 
Join Date: Sep 2007
Posts: 44
Thanks: 2
Thanked 0 Times in 0 Posts
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 (permalink)  
Old 10-10-2007, 06: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 (permalink)  
Old 10-13-2007, 08: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, 108 views)
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #10 (permalink)  
Old 12-23-2007, 11:01 AM
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 (permalink)  
Old 01-12-2008, 10:19 AM
Nefarious's Avatar
iPhone? More like MyPhone
 
Join Date: Nov 2007
Device + Firmware: Iphone 3G 16GB White
Operating System: Vista Ultimate
Posts: 231
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 (permalink)  
Old 01-22-2008, 09: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 (permalink)  
Old 05-05-2008, 07: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

Forum Jump


Go to Top
ModMyI

All times are GMT -6. The time now is 04:42 PM. Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 | Dedicated Server Hosting by SingleHop | Copyright © 2007-09 by ModMy, LLC. All rights reserved.

RSS / Contact Us / / ModMyi Home / Archive / Privacy Statement / Top


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408