dqbn76906 2019-07-30 21:01
浏览 1140

PHP页面显示为Not Found

Im not sure what m doing wrong here but the server cant seem too find my php files hosted on the server. Not sure if this is due to Apache lacking something or php itself. Ive searched all over the internet followed everything I can find and am having no luck.

http://netauto.app.local/data.php thats the file im trying to reach.

-rwxrwxrwx 1 root root  6493 Jul 26 23:47  action_search.php - call this 
-rwxrwxrwx 1 root root   640 Jul 26 23:48  data.php - call this 
-rwxrwxrwx 1 root root    20 Jul 29 21:53  info.php - call this 
-rwxrwxrwx 1 root root 15272 Jul  2 18:43  __init__.py
-rwxrwxrwx 1 root root 12964 Jul  2 18:43  __init__.pyc
drwxrwxrwx 2 root root  4096 Jun 18 16:37  __pycache__
drwxrwxrwx 3 root root  4096 Jul 27 01:46  static
drwxrwxrwx 4 root root  4096 Jul 26 22:48  templates
drwxrwxrwx 6 root root  4096 Apr 10 16:32  venv

Ive elevated everything to root with chmod 777 I want to change that to 644 but was running out of ideas. All the ones marked "call this" return a 404 not found when I try and navigate too it via the url. Also a debug on the website returns a 404 not found when I hit the php action.

folder paths look like this

---------flaskapp.wsgi
-----------------/FlaskApp
---------------------__init__.py
----------------------data.php
----------------------action_search.php
----------------------info.php
----------------------/templetes
----------------------/static

Heres the php mod

root@pdc-mgmt-netutl:/var/www/FlaskApp/FlaskApp# php -v PHP 7.2.19-0ubuntu0.18.04.1 (cli) (built: Jun 4 2019 14:48:12) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.19-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies root@pdc-mgmt-netutl:/var/www/FlaskApp/FlaskApp# cd /etc/apache2/sites-available/

Below is my flask.conf

<VirtualHost *:80>
        WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi
        WSGIDaemonProcess FlaskApp python-home=/var/www/FlaskApp/FlaskApp/venv/
        WSGIProcessGroup FlaskApp
        ServerName localhost
        DocumentRoot /var/www/FlaskApp/FlaskApp/
        <Directory /var/www/FlaskApp/FlaskApp>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                Require all granted
                allow from all
        </Directory>
        Alias /static /var/www/FlaskApp/FlaskApp/static
        <Directory /var/www/FlaskApp/FlaskApp/static/>
                Order allow,deny
                Allow from all
                Require all granted
        </Directory>
        Alias /templetes /var/www/FlaskApp/FlaskApp/templetes
        <Directory /var/www/FlaskApp/FlaskApp/templetes/>
                Order allow,deny
                Allow from all
                Require all granted
        </Directory>
        LoadModule php7_module modules/php7apache2_4.dll
        ErrorLog ${APACHE_LOG_DIR}/error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <IfModule dir_module>
                DirectoryIndex index.html index.php
        </IfModule>
        AddType application/x-httpd-php .php
        AddHandler application/x-httpd-php .php
        PHPIniDir "/etc/php/7.2/apache2/php.ini"
</VirtualHost>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 多址通信方式的抗噪声性能和系统容量对比
    • ¥15 winform的chart曲线生成时有凸起
    • ¥15 msix packaging tool打包问题
    • ¥15 finalshell节点的搭建代码和那个端口代码教程
    • ¥15 Centos / PETSc / PETGEM
    • ¥15 centos7.9 IPv6端口telnet和端口监控问题
    • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 海浪数据 南海地区海况数据,波浪数据
    • ¥20 软件测试决策法疑问求解答