本地主机设置与MAMP& phpMyAdmin的。在此服务器上找不到文件 [英] Local host setup with MAMP & phpMyAdmin. File not found on this server

查看:520
本文介绍了本地主机设置与MAMP& phpMyAdmin的。在此服务器上找不到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何让我的本地.php文件显示出来,所以我看到了我的表单。当我编写本地主机,然后.php文件路径时,我得到未找到页面。

如果我将8889添加到本地主机,它似乎通过MySQL- (8889),而不是Apache端口(8888),然后safari只是将文件下载到我的下载。



这里我附上了一张显示我所有设置的图像。

我使用MAMP,phpMyAdmin和我遵循这个家伙的指南


<解决方案

https://www.youtube.com/watch?v=brpKAM2WXhk =nofollow noreferrer> Mose在优胜美地10.10上的问题我使用10.10.5我也为我工作过






How do i get my local .php file to show up, so i see my form. When i write local host and then path of .php file i get "Not Found" page.

If i add :8889 to local host it seems to run via MySQL-port(8889) instead of Apache-port(8888) and then safari just downloads the file to my downloads.

Here i have attached an images that shows all my settings.

I use MAMP, phpMyAdmin and i follow the guide of this guy (https://youtu.be/wp6Ngpk5XiY?list=PL530D33D6E548481F (17.05=troubleshooting))

Here is the code he use (i have copied his source code)

The communication to MySQL:

    <?php

define('DB_NAME', 'demo');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');
define('DB_HOST', 'localhost');

$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);

if (!$link) {
    die('Could not connect: ' . mysql_error());
}

$db_selected = mysql_select_db(DB_NAME, $link);

if (!$db_selected) {
    die('Can\'t use ' . DB_NAME . ': ' . mysql_error());
}

$value = $_POST['input1'];
$value2 = $_POST['input2'];

$sql = "INSERT INTO demo (input1, input2) VALUES ('$value', '$value2')";

if (!mysql_query($sql)) {
    die('Error: ' . mysql_error());
}

mysql_close();
?>

The form:

<form action="demo.php" method="post" />
<p>Input 1: <input type="text" name="input1" /></p>
<p>Input 2: <input type="text" name="input2" /></p>
<input type="submit" value="Submit" />
</form>

解决方案

Follow this guys instructions and write localhost:8888/demo-form.php

Problems with MAMP on Yosemite 10.10 i use 10.10.5 i also worked for me

这篇关于本地主机设置与MAMP&amp; phpMyAdmin的。在此服务器上找不到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
PHP最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆