Table of Contents
.net转php laraval框架学习系列,.netlaraval
VC11 x86 Non Thread Safe (2014-Oct-02 02:43:40)
做了3年net程序员转php好?
问net转PHP是不是要全部重写?
Home php教程 php手册 .net转php laraval框架学习系列,.netlaraval

.net转php laraval框架学习系列,.netlaraval

Jun 13, 2016 am 09:24 AM
.net php study frame series change

.net转php laraval框架学习系列,.netlaraval

之前也没写过什么博客,可能文章结构比较混乱,想到那写到哪。

主要是把自己学习中的经验写下来。

为什么选择laravel框架,是因为laravel框架目前是Php最流行的框架,深入研究后发现和asp.net mvc框架在功能上基本上是伯仲之间。只是各自的实现方法不同。

php在windows下的开发环境搭建

1.下载php地址 http://windows.php.net/download/ 注意相关版本,我的服务器用的iis7.5 32 系统 

VC11 x86 Non Thread Safe (2014-Oct-02 02:43:40)

解压之后放到相应的目录,配置php.ini文件,这里注意里面的dll启用的相关配置,这个网上有也不多说了。

2.iis 配置

我用的fastcgi 部署的,需要下载phpmanager  https://phpmanager.codeplex.com/

安装完phpmanager 点击iis站点会出现phpmanager的图标

点开之后会出现下面界面,相关设置功能也比较简单,需要注意的是php extensions ,这个和上面php.ini 中的dll启用是一致的。

配置在iis fastcgi模式下 需要启用 php_wincache.dll.记得启用这个。

3.下载laravel 框架,这里需要下载一个composer 一个类似与npm的一个php工具。

安装时需要选择php的版本。如果需要更改php版本,重新安装就可以了

将laravel压缩包解压到laravel文件夹,在laravel文件夹中shfit+右键打开命令窗口

输入  compser intsall 会自动下载相关的依赖组件到vendor文件夹中

4.mysql的安装

mysql安装这里不详细叙述了,基本上没有太大的问题。

后面可能会碰到一个laravel 的 Eloquent ORM 建模报错的问题,

需要把mysql 中的 

# Set the SQL mode to strict
#sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 

修改成

sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

也是网上找到解决方案,如果没有问题最好。

5.所有组件下载完之后开始配置iis php站点

和.net站点一样配置,注意站点的根目录不是laravel文件夹,而是下面的public文件夹。

配置一下host文件和网站的域名。

配置完成,点开phpmanager 中的check phpinfo();查看安装

程序池不需要更改,2.0的集成模式就可以了,

6.这时基本上就完成所有组件的安装。

访问上一步设置的网站域名。就可以看到laravel欢迎页。

这里还有一个特别要注意的地方,由于laravel生成的url也是不带后缀的,会出现404的错误,

需要安装IIS Url Rewrite 组件

安装完成之后

进入rewrite 界面点击右侧导入规则

然后选择public 文件下的.htaccess文件

导入完之后应用规则就行了。

以上步骤基本上就搭建完laravel在window iis中运行环境

 

做了3年net程序员转php好?

技多不压身
学PHP不一定要放弃.net啊
漂亮的页面做到极致也是挺不容易的
没有一个人什么程序都会
只有把最擅长的尽量做到极致就可以了
 

问net转PHP是不是要全部重写?

.net转PHP需要全部重写。
不过有了原来的框架结构,重写会比重新开发相对快许多。
要求程序员精通.NET与PHP两们语言。

数据库是个复杂一些的问题。主要是数据转换。
这都取决与程序员的技术。转换时间跟数据库的大小,数据结构的复杂程度有关。

一般来说,如果数据结构都是自己开发的,很快就能转换过来
最多不超过1周。
 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

7 PHP Functions I Regret I Didn't Know Before 7 PHP Functions I Regret I Didn't Know Before Nov 13, 2024 am 09:42 AM

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

See all articles