Page 1 of 3 123 LastLast
Results 1 to 20 of 60

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.

Thread: [Question] Apache/PHP/MySQL and running a webserver on an iDevice (iOS 4.0+)

  1. #1
    Post [Question] Apache/PHP/MySQL and running a webserver on an iDevice (iOS 4.0+)
    First off-- This is a serious discussion. Please don't do/say the following:

    • "What's the point"
    • "This is stupid"
    • "What a waste of time"
    • "It can't be done"
    • " will waste your battery/wifi/disk writing"
    • "SQLite works fine"
    • Or any derivative of this

    I will report ALL nasty comments and derogatory statements to the mods. Be respectful.

    Yes yes, I know...there's already THREADS FOR THIS, but look closely and you will see they are outdated by 3 years. 2007 and iOS 1.0/ was a LONG time ago. Also, none of them cover how to get MySQL working. Only PHP and Apache. Plus, the packages they reference are gone.

    I need this in order to demo sites for clients and to have a development machine at all times so I can test new code, hook to a db and more. This is [COLOR="rgb(139, 0, 0)"]not[/COLOR] a hobby.

    As of now I have PHP and lighttpd (plus 'lighttpd SBSettings') installed via Cydia. (note: PHP installs via iPHPPod). I was able to find an iPhone friendly version of MySQL here: LINK (directions for installing are included in a readme)

    Now, that said PHP does not see MySQL. PHP doesn't have the MySQL module/extension installed. It only has a PDO for attaching to SQLite. Problem is, most web apps (Wordpress, etc) need MySQL to work. SQLite doesn't have the same parameters as MySQL. In fact i find ZERO information on how to attach it or use it. There's no username/password/server address like with MySQL. BUT THAT DOESN'T MATTER. I do NOT want to use SQLite. I can't. Besides, it's slow. I already tried it.

    Note: Wordpress does have a PLUGIN that allows you to use SQlite, but what about all the other apps I want to install? No options.

    phpmyadmin also doesn't work. Without MySQL it won't work. It can't.

    So, the point of this thread is:

    How do we attach PHP/Apache/MySQL and have a full running webserver on our iDevice?

    I have searched for 3 days and my Google-Fu is strong. However, nothing relative to this exists. It seems odd there's no package for this, anywhere. There used to be a great tutorial HERE, but all the files are gone.

    So, let's get this going. I know someone has to be interested.

    I have included a screenshot of phpinfo running to prove it is a working server. Now it needs MySQL to be a better, more usable, server.
    Attached Thumbnails Attached Thumbnails -img_0014.png   -snapshot-2010-10-26-16-30-43smaller.jpg  

  2. The Following User Says Thank You to therealduckie For This Useful Post:

    CrystalFire (2011-10-28)

  3. #2
    additional update:

    I can add databases and configure and run MYSQL (via SSH terminal), but I'm still stumped on how to get it working with lighttpd and PHP.

    This was relevant in another thread, so pasting it here to help the conversation:

    one of my problems is that I use a pay-as-you-go SIM card and I don't have a data connection.

    As for the module, I'm not great at coding, but I would have to guess tere is a way to compile it on the phone for the specific processor. I just don't have the technical know-how. Seeing as MySQL works as does PHP and the link I offered shows it was, at one time, possible...that tell me someone still has that code or that it has already been done, so entirely possible.

    Found another tutorial here: Forum iTouch / [Tuto] Serveur Apache avec PHP et MySQL

    But, like the iAmps site...the files are gone. Need the php.gz and php-cgi.gz that were there

    I wanted to share some screenshots to give you guys an idea how this can be helpful land how well it works, so far.

    Everything you see is running on my iPhone 3G.

    Main Index - This link is the Index File so you can use it on your server. Better than a plain boring HTML page and sized for iPhone.

    iPHPpod - an alternative to the iPod player. You can upload your own files via SSH without using iTunes. INCLUDING MOVIES

    iWebKit - the standard kit for making a web based app

    PHP - PHP running (with some of the iPhone server settings visible)

    Wordpress - Uploaded to the server, but not working since there is no MySQL

    Wordpress - As you can see, this is as far as it gets

    eyeOS - a web based operating system with amazing features.

    DirList - a CSS formatted directory listing

    As you can see, it has a purpose and can be even MORE amazing with MySQL.

    Last edited by therealduckie; 2010-10-29 at 05:45 PM. Reason: Automerged Doublepost

  4. #3
    That's pretty cool.

    What would you use this for? (different than what is the point :P)
    mod edit/link removed.

  5. #4
    I'm totally interested in this for the appletv v2 use case. It should make for a great low end web host. I'm out right now but I'll take a deeper look later and see if there's something I can do to help!

  6. #5
    thank you, yes please. This project could use a lot more people.

    The prospect of a $99 server is amazing.

    Oh, and BitBass: let me know if you get it running or have it running already.
    Last edited by therealduckie; 2010-11-04 at 06:31 PM. Reason: Automerged Doublepost

  7. #6

  8. #7
    Quote Originally Posted by therealduckie View Post
    I have the same problem, installed phppod but dont have mysql working. I even cannot find php.ini file to configure it.
    As I understood it should be here /usr/lib aftet installation but its not. Did you have the same?
    By the way my mail is deli6z(at) please write me here

  9. #8
    php.ini has to be created. Look at your phpinfo to see the path where it needs to go. Either way, you won't find MySQL because it isn't there. phppod uses SQlite but SQlite is slooooooow and useless for web development.

  10. #9
    Quote Originally Posted by therealduckie View Post
    php.ini has to be created. Look at your phpinfo to see the path where it needs to go. Either way, you won't find MySQL because it isn't there. phppod uses SQlite but SQlite is slooooooow and useless for web development.
    yes I know the path, but what do I need write to the php.ini?

    php is working even without this file.
    did you find the way to make mysql working?

  11. #10
    You need to have an understanding of PHP in order to make a php.ini - It is not something you just randomly create a file for. It's usually used when you need to change paths, adjust memory, and more.

    And no, I am still waiting for more people to engage in conversation about this so that it can develop further.

    If I had the MySQL file I would share it here.

  12. #11
    Can u pls share your php.ini file?

  13. #12
    Sure, although I am not sure how it will help you


    extension =
    extension = mysql_php
    extension_dir = /var/root/mysql

    ; Allow or prevent persistent links.
    mysql.allow_persistent = On

    ; Maximum number of persistent links. -1 means no limit.
    mysql.max_persistent = -1

    ; Maximum number of links (persistent + non-persistent). -1 means no limit.
    mysql.max_links = -1

    ; Default port number for mysql_connect(). If unset, mysql_connect() will use
    ; the or the mysql-tcp entry in /etc/services or the
    ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
    ; at MYSQL_PORT.
    mysql.default_port =

    ; Default socket name for local MySQL connects. If empty, uses the built-in
    ; MySQL defaults.
    mysql.default_socket =

    ; Default host for mysql_connect() (doesn't apply in safe mode).
    mysql.default_host = localhost

    ; Default user for mysql_connect() (doesn't apply in safe mode).
    mysql.default_user = root

    ; Default password for mysql_connect() (doesn't apply in safe mode).
    ; Note that this is generally a *bad* idea to store passwords in this file.
    ; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
    ; and reveal this password! And of course, any users with read access to this
    ; file will be able to reveal the password as well.
    mysql.default_password = ******

    ; Maximum time (in secondes) for connect timeout. -1 means no limit
    mysql.connect_timeout = 60

    ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
    ; SQL-Errors will be displayed.
    mysql.trace_mode = Off
    ; End:
    Just because I have a path to MySQL doesn't mean I have it installed. It's there for my personal reference once I find a working copy of it.
    Last edited by therealduckie; 2010-11-12 at 01:50 AM.

  14. #13
    Where did you get this code, its yours?
    Last edited by Deli6z; 2010-11-12 at 02:21 AM.

  15. #14

    You should really read more of the thread. All your questions are answered above.

  16. #15
    You said nothing about php.ini file before, so how can I know? Usually when you're installing php on pc its appears automatically, in my case I dont have it at all, it just havent being created. My question was- did you create it and put all that code by yourself? Thank you for the answer
    Last edited by Deli6z; 2010-11-12 at 04:12 AM.

  17. #16
    I used a server I have running on my mac for the info, however all of it refers to MySQL which is not installed...unless someone wants to crawl out of the woodwork and post it. *HINT HINT* you know who you are. Seriously, I find it odd this thread is in 3 of the most popular iPhone communities on the web and no one has offered the file.

  18. #17
    I have an iPhone friendly install of MySQL, but my PHP install does not use a PHP.ini file; it's based on a Linux install - it used various .h files.

    Could you please supply the install of PHP you used? Thanks!

    I can't attach the file, as it is too large. (10 MB or so.) I'm behind a restrictive proxy, so I can't upload the file to a 3rd party site. I will do so when I have the chance.

  19. #18
    Quote Originally Posted by Kamikengen View Post
    Could you please supply the install of PHP you used?.
    PHP Version 5.2.8

    It was installed as a part of the PHPPod software I installed via Cydia.

  20. #19
    Quote Originally Posted by therealduckie View Post
    PHP Version 5.2.8

    It was installed as a part of the PHPPod software I installed via Cydia.
    Ah, ok.

    I installed PHP separately on Cydia, so my install may be different to yours.

    As I said before, I have an iPhone friendly install of MySQL, do you want it?

  21. #20
    Yes, very much so, Please.

Page 1 of 3 123 LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts