php 5.5.5 not working with Apache 2.4.7

前端 未结 5 477
被撕碎了的回忆
被撕碎了的回忆 2021-01-06 15:31

OK, so recently I decided to upgrade my server. I downloaded apache 2.4.7 "httpd-2.4.7-win32-VC11.zip" and extracted all the files, configured them for my use and

相关标签:
5条回答
  • 2021-01-06 16:04

    I am not sure what solved it. But this is all I DID

    -Did a fresh install of win 7 64 bits from scratch
    -Installed Visual Redistributed x86 and x64
    -Installed Apache 2.4.7 and php 5.5.5
    -made sure to save php file with .php ending and saved it in ANSI or UTF-8 Encoding ..not unicode (I think this was the problem  ...  :D stupid me )
    

    And voilà ...its working

    0 讨论(0)
  • 2021-01-06 16:04

    When you say that you can see the code, you mean the browser prompts you to download the .php file right? Or does it display it onscreen? If its prompting to download the file, usually that means there's an Apache Handler issue. Try moving your AddType rule in between the mime_module conditional tags

    <IfModule mime_module>
        TypesConfig conf/mime.types
        # comment lines not shown
        AddType application/x-compress .Z
        AddType application/x-gzip .gz .tgz
        AddType application/x-httpd-php .php    
    </IfModule>
    
    0 讨论(0)
  • 2021-01-06 16:08

    Make sur you have full PHP tags.

    or set in your php configuration file, short_open_tag = On

    0 讨论(0)
  • 2021-01-06 16:09
    1. Download libphp7.so file
    2. Copy that file in /etc/httpd/modules
    3. Open httpd.conf file and paste this

      LoadModule php7_module modules/libphp7.so

    4. Restart Web Server
    0 讨论(0)
  • 2021-01-06 16:14

    From what I understand, the default new config for apache 2.4 doesn't include PHP module. Make sure you add

    LoadModule php5_module modules/libphp5.so    
    AddHandler php5-script php
    

    to your httpd.conf. I also had to manually re-enable a lot of modules that were commented out by default in the new default config.

    Also make sure to prevent threaded MPM as PHP does not like it (http://www.php.net/manual/en/faq.installation.php#faq.installation.apache2).

    To use previous MPM config change http.conf to

    LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
    #LoadModule mpm_event_module modules/mod_mpm_event.so
    
    0 讨论(0)
提交回复
热议问题