Help with Apache & PHP

Discussion in 'Web Design and Development' started by jgmachine, Jan 31, 2009.

  1. jgmachine macrumors newbie

    Joined:
    Jul 14, 2006
    #1
    So I must have hit every single snag along the way trying to get PHP working properly on my Mac. I have used MAMP, which works fine. BUT... I plan on doing some hardcore developing here soon and I want to get this setup the right way.

    I am a bit of a n00b when it comes to the command line, but I know some of the basics... I've come across several issues/problems and have googled everything along the way.... I dunno wtf... It's frustrating... It makes me want to give up before I've even gotten started on any web design...

    So I thought I had installed everything correctly following these simple directions:
    http://www.freemacblog.com/mac-server-series-setting-up-php-and-mysql/

    Installed Entropy... which was giving me problems with an install error. Finally worked around that.

    Turned on Web Sharing. When I try to view my localhost I get a Page Load Error, "Failed to Connect" in Firefox.

    I read that my Apache install could be the problem... So I was trying to re-install Apache from the binary and following these directions:
    http://fatalerror.wordpress.com/200...ql-postgresql-on-mac-osx-leopard-from-source/

    After putting the code in for Intel Macs from that page into terminal I get:
    checking for chosen layout... Richard5
    checking for working mkdir -p... yes
    checking build system type... i386-apple-darwin9.6.0
    checking host system type... i386-apple-darwin9.6.0
    checking target system type... i386-apple-darwin9.6.0

    Configuring Apache Portable Runtime library ...

    configuring package in srclib/apr now
    checking build system type... i386-apple-darwin9.6.0
    checking host system type... i386-apple-darwin9.6.0
    checking target system type... i386-apple-darwin9.6.0
    Configuring APR library
    Platform: i386-apple-darwin9.6.0
    checking for working mkdir -p... yes
    APR Version: 1.3.3
    checking for chosen layout... apr
    checking for gcc... gcc
    checking for C compiler default output file name...
    configure: error: in `/Users/jgmachine/Downloads/httpd-2.2.11/srclib/apr':
    configure: error: C compiler cannot create executables
    See `config.log' for more details.
    configure failed for srclib/apr

    I read that the C compiler thing could be due to XCode not being fully installed... so I downloaded XCode from Apple and reinstalled that. Tried again, same error.

    I'm running OSX 10.5.6 on an Intel iMac... Any more info you need please ask.

    Help! :(
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    I've never understood why people feel MAMP isn't good enough for production. No one ever seems to provide any real evidence.

    Anyways, that's besides the point. Not sure I can help much, but here's some thoughts. You mentioned turning on the web sharing, but also mentioned installing a different version of Apache. The web sharing is likely still looking for the old Apache so don't turn on web sharing, just leave it off. Since you installed a new Apache you'll want to start it from the command line. I'm not sure if your install including adding the Apache executable into the include path, where you can just type Apache's commands without their full path.

    Try doing a 'which apachectl' and see where it says that executable is at. If it points to nothing the path wasn't updated for it. If you know where Apache was installed you can try,
    Code:
    path/to/apache/bin/apachectl start
    to get things turned on. Then you can check localhost in your browser to see if it started up properly.

    This is a start anyways. See if that takes you forward any or if you've already tried this.
     
  3. jgmachine thread starter macrumors newbie

    Joined:
    Jul 14, 2006
    #3
    Well my install of Apache has never finished... I'm currently stuck on the error I'm getting trying to compile the binary....

    checking for C compiler default output file name...
    configure: error: in `/Users/jgmachine/Downloads/httpd-2.2.11/srclib/apr':
    configure: error: C compiler cannot create executables
    See `config.log' for more details.
    configure failed for srclib/apr
     
  4. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #4
    Need to see that config.log generated during the failed compile. It's likely in the same directory where you ran the command, but if you can't find it use "locate config.log" to find it. Then "cat config.log", highlight the output and copy/paste here.

    -jim
     
  5. jgmachine thread starter macrumors newbie

    Joined:
    Jul 14, 2006
    #5
    Here's what the config.log gives me:

    jgmachine:httpd-2.2.11 jgmachine$ cat config.log
    This file contains any messages produced by compilers while
    running configure, to aid debugging if configure makes a mistake.

    It was created by configure, which was
    generated by GNU Autoconf 2.63. Invocation command line was

    $ ./configure --enable-layout=Richard5 --enable-mods-shared=all --with-ssl=/usr --with-mpm=prefork --enable-ssl --enable-dav --enable-cache --enable-proxy --enable-shared --disable-static --disable-unique-id --disable-ipv6 --enable-logio --enable-deflate --with-ldap --with-ldap-include=/usr/include --with-ldap-lib=/usr/lib --with-included-apr --enable-ldap --enable-auth-ldap --enable-cgi --enable-cgid --enable-suexec

    ## --------- ##
    ## Platform. ##
    ## --------- ##

    hostname = jgmachine.local
    uname -m = i386
    uname -r = 9.6.0
    uname -s = Darwin
    uname -v = Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386

    /usr/bin/uname -p = i386
    /bin/uname -X = unknown

    /bin/arch = unknown
    /usr/bin/arch -k = unknown
    /usr/convex/getsysinfo = unknown
    /usr/bin/hostinfo = Mach kernel version:
    Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
    Kernel configured for up to 2 processors.
    2 processors are physically available.
    2 processors are logically available.
    Processor type: i486 (Intel 80486)
    Processors active: 0 1
    Primary memory available: 3.00 gigabytes
    Default processor set: 89 tasks, 408 threads, 2 processors
    Load average: 0.70, Mach factor: 1.32
    /bin/machine = unknown
    /usr/bin/oslevel = unknown
    /bin/universe = unknown

    PATH: /usr/local/bin
    PATH: /usr/local/sbin
    PATH: /usr/local/mysql/bin
    PATH: /usr/bin
    PATH: /bin
    PATH: /usr/sbin
    PATH: /sbin
    PATH: /usr/local/bin
    PATH: /usr/X11/bin
    PATH: /usr/local/git/bin


    ## ----------- ##
    ## Core tests. ##
    ## ----------- ##

    configure:2500: checking for chosen layout
    configure:2502: result: Richard5
    configure:3307: checking for working mkdir -p
    configure:3323: result: yes
    configure:3340: checking build system type
    configure:3358: result: i386-apple-darwin9.6.0
    configure:3380: checking host system type
    configure:3395: result: i386-apple-darwin9.6.0
    configure:3417: checking target system type
    configure:3432: result: i386-apple-darwin9.6.0

    ## ---------------- ##
    ## Cache variables. ##
    ## ---------------- ##

    ac_cv_build=i386-apple-darwin9.6.0
    ac_cv_env_CC_set=
    ac_cv_env_CC_value=
    ac_cv_env_CFLAGS_set=set
    ac_cv_env_CFLAGS_value='-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk'
    ac_cv_env_CPPFLAGS_set=
    ac_cv_env_CPPFLAGS_value=
    ac_cv_env_CPP_set=
    ac_cv_env_CPP_value=
    ac_cv_env_LDFLAGS_set=
    ac_cv_env_LDFLAGS_value=
    ac_cv_env_LIBS_set=
    ac_cv_env_LIBS_value=
    ac_cv_env_build_alias_set=
    ac_cv_env_build_alias_value=
    ac_cv_env_host_alias_set=
    ac_cv_env_host_alias_value=
    ac_cv_env_target_alias_set=
    ac_cv_env_target_alias_value=
    ac_cv_host=i386-apple-darwin9.6.0
    ac_cv_mkdir_p=yes
    ac_cv_target=i386-apple-darwin9.6.0

    ## ----------------- ##
    ## Output variables. ##
    ## ----------------- ##

    APACHECTL_ULIMIT=''
    APR_BINDIR=''
    APR_CONFIG=''
    APR_INCLUDEDIR=''
    APR_VERSION=''
    APU_BINDIR=''
    APU_CONFIG=''
    APU_INCLUDEDIR=''
    APU_VERSION=''
    AP_BUILD_SRCLIB_DIRS=''
    AP_CLEAN_SRCLIB_DIRS=''
    AP_LIBS=''
    AWK=''
    BUILTIN_LIBS=''
    CC=''
    CFLAGS='-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk'
    CORE_IMPLIB=''
    CORE_IMPLIB_FILE=''
    CPP=''
    CPPFLAGS=''
    CXX=''
    CXXFLAGS=''
    DEFS=''
    DSO_MODULES=''
    ECHO_C='\c'
    ECHO_N=''
    ECHO_T=''
    EGREP=''
    EXEEXT=''
    EXTRA_CFLAGS=''
    EXTRA_CPPFLAGS=''
    EXTRA_CXXFLAGS=''
    EXTRA_INCLUDES=''
    EXTRA_LDFLAGS=''
    EXTRA_LIBS=''
    GREP=''
    HTTPD_LDFLAGS=''
    HTTPD_VERSION=''
    INCLUDES=''
    INSTALL=''
    INSTALL_DSO=''
    INSTALL_PROG_FLAGS=''
    LDFLAGS=''
    LIBOBJS=''
    LIBS=''
    LIBTOOL=''
    LN_S=''
    LTCFLAGS=''
    LTFLAGS=''
    LTLIBOBJS=''
    LT_LDFLAGS=''
    LYNX_PATH=''
    MKDEP=''
    MKINSTALLDIRS=''
    MK_IMPLIB=''
    MODULE_CLEANDIRS=''
    MODULE_DIRS=''
    MOD_ACTIONS_LDADD=''
    MOD_ALIAS_LDADD=''
    MOD_ASIS_LDADD=''
    MOD_AUTHNZ_LDAP_LDADD=''
    MOD_AUTHN_ALIAS_LDADD=''
    MOD_AUTHN_ANON_LDADD=''
    MOD_AUTHN_DBD_LDADD=''
    MOD_AUTHN_DBM_LDADD=''
    MOD_AUTHN_DEFAULT_LDADD=''
    MOD_AUTHN_FILE_LDADD=''
    MOD_AUTHZ_DBM_LDADD=''
    MOD_AUTHZ_DEFAULT_LDADD=''
    MOD_AUTHZ_GROUPFILE_LDADD=''
    MOD_AUTHZ_HOST_LDADD=''
    MOD_AUTHZ_OWNER_LDADD=''
    MOD_AUTHZ_USER_LDADD=''
    MOD_AUTH_BASIC_LDADD=''
    MOD_AUTH_DIGEST_LDADD=''
    MOD_AUTOINDEX_LDADD=''
    MOD_BUCKETEER_LDADD=''
    MOD_CACHE_LDADD=''
    MOD_CASE_FILTER_IN_LDADD=''
    MOD_CASE_FILTER_LDADD=''
    MOD_CERN_META_LDADD=''
    MOD_CGID_LDADD=''
    MOD_CGI_LDADD=''
    MOD_CHARSET_LITE_LDADD=''
    MOD_DAV_FS_LDADD=''
    MOD_DAV_LDADD=''
    MOD_DAV_LOCK_LDADD=''
    MOD_DBD_LDADD=''
    MOD_DEFLATE_LDADD=''
    MOD_DIR_LDADD=''
    MOD_DISK_CACHE_LDADD=''
    MOD_DUMPIO_LDADD=''
    MOD_ECHO_LDADD=''
    MOD_ENV_LDADD=''
    MOD_EXAMPLE_LDADD=''
    MOD_EXPIRES_LDADD=''
    MOD_EXT_FILTER_LDADD=''
    MOD_FILE_CACHE_LDADD=''
    MOD_FILTER_LDADD=''
    MOD_HEADERS_LDADD=''
    MOD_HTTP_LDADD=''
    MOD_IDENT_LDADD=''
    MOD_IMAGEMAP_LDADD=''
    MOD_INCLUDE_LDADD=''
    MOD_INFO_LDADD=''
    MOD_ISAPI_LDADD=''
    MOD_LDAP_LDADD=''
    MOD_LOGIO_LDADD=''
    MOD_LOG_CONFIG_LDADD=''
    MOD_LOG_FORENSIC_LDADD=''
    MOD_MEM_CACHE_LDADD=''
    MOD_MIME_LDADD=''
    MOD_MIME_MAGIC_LDADD=''
    MOD_NEGOTIATION_LDADD=''
    MOD_OPTIONAL_FN_EXPORT_LDADD=''
    MOD_OPTIONAL_FN_IMPORT_LDADD=''
    MOD_OPTIONAL_HOOK_EXPORT_LDADD=''
    MOD_OPTIONAL_HOOK_IMPORT_LDADD=''
    MOD_PROXY_AJP_LDADD=''
    MOD_PROXY_BALANCER_LDADD=''
    MOD_PROXY_CONNECT_LDADD=''
    MOD_PROXY_FTP_LDADD=''
    MOD_PROXY_HTTP_LDADD=''
    MOD_PROXY_LDADD=''
    MOD_REWRITE_LDADD=''
    MOD_SETENVIF_LDADD=''
    MOD_SO_LDADD=''
    MOD_SPELING_LDADD=''
    MOD_SSL_LDADD=''
    MOD_STATUS_LDADD=''
    MOD_SUBSTITUTE_LDADD=''
    MOD_SUEXEC_LDADD=''
    MOD_UNIQUE_ID_LDADD=''
    MOD_USERDIR_LDADD=''
    MOD_USERTRACK_LDADD=''
    MOD_VERSION_LDADD=''
    MOD_VHOST_ALIAS_LDADD=''
    MPM_LIB=''
    MPM_NAME=''
    MPM_SUBDIR_NAME=''
    NOTEST_CFLAGS=''
    NOTEST_CPPFLAGS=''
    NOTEST_CXXFLAGS=''
    NOTEST_LDFLAGS=''
    NOTEST_LIBS=''
    OBJEXT=''
    OS=''
    OS_DIR=''
    OS_SPECIFIC_VARS=''
    PACKAGE_BUGREPORT=''
    PACKAGE_NAME=''
    PACKAGE_STRING=''
    PACKAGE_TARNAME=''
    PACKAGE_VERSION=''
    PATH_SEPARATOR=':'
    PCRE_CONFIG=''
    PICFLAGS=''
    PILDFLAGS=''
    PKGCONFIG=''
    PORT=''
    POST_SHARED_CMDS=''
    PRE_SHARED_CMDS=''
    RANLIB=''
    RM=''
    RSYNC=''
    SHELL='/bin/sh'
    SHLIBPATH_VAR=''
    SHLTCFLAGS=''
    SH_LDFLAGS=''
    SH_LIBS=''
    SH_LIBTOOL=''
    SSLPORT=''
    SSL_LIBS=''
    UTIL_LDFLAGS=''
    ab_LTFLAGS=''
    abs_srcdir=''
    ac_ct_CC=''
    ap_make_delimiter=''
    ap_make_include=''
    bindir='${exec_prefix}/bin'
    build='i386-apple-darwin9.6.0'
    build_alias=''
    build_cpu='i386'
    build_os='darwin9.6.0'
    build_vendor='apple'
    cgidir='${datadir}/cgi-bin'
    checkgid_LTFLAGS=''
    datadir='${prefix}'
    datarootdir='${prefix}/share'
    docdir='${datarootdir}/doc/${PACKAGE}'
    dvidir='${docdir}'
    errordir='${datadir}/error'
    exec_prefix='${prefix}'
    exp_bindir='/Library/Apache2/bin'
    exp_cgidir='/Library/Apache2/cgi-bin'
    exp_datadir='/Library/Apache2'
    exp_errordir='/Library/Apache2/error'
    exp_exec_prefix='/Library/Apache2'
    exp_htdocsdir='/Library/Apache2/htdocs'
    exp_iconsdir='/Library/Apache2/icons'
    exp_includedir='/Library/Apache2/include'
    exp_installbuilddir='/Library/Apache2/build'
    exp_libdir='/Library/Apache2/lib'
    exp_libexecdir='/Library/Apache2/modules'
    exp_localstatedir='/Library/Apache2'
    exp_logfiledir='/Library/Apache2/logs'
    exp_mandir='/Library/Apache2/man'
    exp_manualdir='/Library/Apache2/manual'
    exp_proxycachedir='/Library/Apache2/proxy'
    exp_runtimedir='/Library/Apache2/logs'
    exp_sbindir='/Library/Apache2/bin'
    exp_sysconfdir='/Library/Apache2/conf'
    host='i386-apple-darwin9.6.0'
    host_alias=''
    host_cpu='i386'
    host_os='darwin9.6.0'
    host_vendor='apple'
    htcacheclean_LTFLAGS=''
    htdbm_LTFLAGS=''
    htdigest_LTFLAGS=''
    htdocsdir='${datadir}/htdocs'
    htmldir='${docdir}'
    htpasswd_LTFLAGS=''
    httxt2dbm_LTFLAGS=''
    iconsdir='${datadir}/icons'
    includedir='${prefix}/include'
    infodir='${datarootdir}/info'
    installbuilddir='${datadir}/build'
    libdir='${exec_prefix}/lib'
    libexecdir='${exec_prefix}/modules'
    localedir='${datarootdir}/locale'
    localstatedir='${prefix}'
    logfiledir='${localstatedir}/logs'
    logresolve_LTFLAGS=''
    mandir='${prefix}/man'
    manualdir='${datadir}/manual'
    nonssl_listen_stmt_1=''
    nonssl_listen_stmt_2=''
    oldincludedir='/usr/include'
    other_targets=''
    pdfdir='${docdir}'
    perlbin=''
    prefix='/Library/Apache2'
    progname=''
    program_transform_name='s,x,x,'
    proxycachedir='${localstatedir}/proxy'
    psdir='${docdir}'
    rel_bindir='bin'
    rel_cgidir='cgi-bin'
    rel_datadir=''
    rel_errordir='error'
    rel_exec_prefix=''
    rel_htdocsdir='htdocs'
    rel_iconsdir='icons'
    rel_includedir='include'
    rel_installbuilddir='build'
    rel_libdir='lib'
    rel_libexecdir='modules'
    rel_localstatedir=''
    rel_logfiledir='logs'
    rel_mandir='man'
    rel_manualdir='manual'
    rel_proxycachedir='proxy'
    rel_runtimedir='logs'
    rel_sbindir='bin'
    rel_sysconfdir='conf'
    rotatelogs_LTFLAGS=''
    runtimedir='${localstatedir}/logs'
    sbindir='${exec_prefix}/bin'
    shared_build=''
    sharedstatedir='${prefix}/com'
    sysconfdir='${prefix}/conf'
    target='i386-apple-darwin9.6.0'
    target_alias=''
    target_cpu='i386'
    target_os='darwin9.6.0'
    target_vendor='apple'

    configure: exit 1
    jgmachine:httpd-2.2.11 jgmachine$
     
  6. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #6
    You're in DANGEROUS territory here.
    Read ENTIRE reply before doing anything.

    The log says during the compile you tried to use the existing apr library ("--with-included-apr") but the compile error is most likely (not sure) related to the apr-util package which apparently is not installed on your computer -- or installed incorrectly due to other ports screwing it up. Installing packages on a Mac (which is Darwin under the hood) involves ported code (ports).

    Here is a page with detailed help to install the latest apr-util on Mac OS-X:

    http://apr-util.darwinports.com/

    WARNING: I am not 100% sure this is what you need to do, installing ports to change the default Mac behavior and libraries is NEVER advised, likely breaks all warranty and support, and can cause issue with native Mac software. Always backup first, and you're on your own if this doesn't work. MAMP is still the suggested course of action, but beyond that this advice is based on the information you provided and is a likely resolution. If it works, great, let me know. If not, I will not offer any further support and will leave it to others to help who are more experienced.

    -jim
     
  7. jgmachine thread starter macrumors newbie

    Joined:
    Jul 14, 2006
    #7
    You're scaring me here now! haha... ummm...

    Was I doing something to change ports or if I try to install that will it change ports? I don't want to do anything that's taking me further into dangerous territory.... I'd like to just get this all fixed and running properly :confused:

    Well... I guess I'll check out that link and give it a try....
     
  8. jgmachine thread starter macrumors newbie

    Joined:
    Jul 14, 2006
    #8
    Now I can't install darwin ports.... the instructions say...

    *

    How To Install Darwin Ports:

    This is a two-step process and is easy to get working. The first step is to download and run the Darwin Ports installer located here: download.darwinports.com. The second step is to update the ports so that they are current on your Mac. To do this, open a terminal window and check the project out of the CVS repository with the following command and enter the root password when prompted:

    % sudo port -d selfupdate

    I get this:
    sudo: port: command not found

    sooooo......? Why the hell am I so dumb!?
     
  9. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #9
  10. jgmachine thread starter macrumors newbie

    Joined:
    Jul 14, 2006
    #10
  11. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #11
    Okay, that link correction matters.

    That page says at the top to view the "new" help found found here:

    http://diymacserver.com/installing-apache/compiling-apache/

    On that page, for Tiger, use the ./configure arguments listed there (they seem different than those you used based on that log) and read the blog comments if any situation applies to your setup. Apparently this is done by editing config.layout. Notice sudo is used in some commands during compile. Recompile as instructed there, for your proper chipset (Intel vs. Power PC). If that fails, recompile once more but this time *remove* the "--with-included-apr" argment from config.layout to install Apache without using any included APR files. See what happens. Backup that config.layout before all attempts.

    Note: Beyond this advice, now that you sent the instruction page, I haven't a clue - I suggest wait for others to reply if same errors, otherwise post the new errors and your config.log here, or leave a comment on that instruction page and seek help there as well.

    -jim
     
  12. Mr.nix macrumors member

    Joined:
    Jan 30, 2007
    #12
    I might be to late but I also need more then what MAMP offers (mostly for SphinxSE development).

    What I use is for Apache, php and MySQL is http://www.macports.org/.

    It's very easy to macports with the install package and after that the rest are pretty easy also. If you go this route I can help you out.
     
  13. Steeph28 macrumors newbie

    Joined:
    Aug 8, 2005
    #13
    Concerning your apr problems...

    Couldn't you use the apr and apr-util that come bundled with the package you downloaded instead of using the with-included option?

    To build Apache HTTPd against a manually installed apr/apr-util (http://httpd.apache.org/docs/2.2/install.html):

    # Build and install apr 1.2
    cd srclib/apr
    ./configure --prefix=/usr/local/apr-httpd/
    make
    make install

    # Build and install apr-util 1.2
    cd ../apr-util
    ./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
    make
    make install

    Then when you actually compile Apache you can point to where they are:

    # Configure httpd
    cd ../../
    ./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/

    Hopefully that's what you were looking for. Good luck!
     
  14. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #14
    Steeph28 - that makes perfect sense, thanks for jumping in with that excellent advice for both libraries. One minor correction, the link doesn't work in your post (post related, link is fine which is http://httpd.apache.org/docs/2.2/install.html)

    OP - give it a shot, let us know!

    -jim
     

Share This Page